chore(common): analytics on spotlight (#3727)

Co-authored-by: amk-dev <akash.k.mohan98@gmail.com>
This commit is contained in:
James George
2024-02-02 15:32:06 +05:30
committed by GitHub
parent aab76f1358
commit d7cdeb796a
10 changed files with 267 additions and 76 deletions

View File

@@ -1,5 +1,5 @@
import { onBeforeUnmount, onMounted } from "vue"
import { HoppActionWithNoArgs, invokeAction } from "./actions"
import { HoppActionWithOptionalArgs, invokeAction } from "./actions"
import { isAppleDevice } from "./platformutils"
import { isDOMElement, isTypableElement } from "./utils/dom"
@@ -40,7 +40,7 @@ type SingleCharacterShortcutKey = `${Key}`
type ShortcutKey = ModifierBasedShortcutKey | SingleCharacterShortcutKey
export const bindings: {
[_ in ShortcutKey]?: HoppActionWithNoArgs
[_ in ShortcutKey]?: HoppActionWithOptionalArgs
} = {
"ctrl-enter": "request.send-cancel",
"ctrl-i": "request.reset",
@@ -96,7 +96,7 @@ function handleKeyDown(ev: KeyboardEvent) {
if (!boundAction) return
ev.preventDefault()
invokeAction(boundAction)
invokeAction(boundAction, undefined, "keypress")
}
function generateKeybindingString(ev: KeyboardEvent): ShortcutKey | null {