mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Track clear search
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
import { clearSubPanels, popSubPanel, subPanels } from '../subPanels';
|
||||
import { IconArrowSmRight } from '@appwrite.io/pink-icons-svelte';
|
||||
import { Icon, Keyboard, Layout } from '@appwrite.io/pink-svelte';
|
||||
import { Submit, trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
/* eslint no-undef: "off" */
|
||||
type Option = $$Generic<Omit<Command, 'group'> & { group?: string }>;
|
||||
@@ -22,6 +23,7 @@
|
||||
let selected = 0;
|
||||
let usingKeyboard = false;
|
||||
let contentEl: HTMLElement;
|
||||
let didSearch = false;
|
||||
|
||||
async function triggerOption(option: Option) {
|
||||
const prevPanels = $subPanels.length;
|
||||
@@ -43,6 +45,14 @@
|
||||
if (!open) return;
|
||||
usingKeyboard = true;
|
||||
|
||||
if (search.length > 0) {
|
||||
didSearch = true;
|
||||
}
|
||||
|
||||
if (search === '' && didSearch) {
|
||||
trackEvent(Submit.SearchClear);
|
||||
}
|
||||
|
||||
let canceled = false;
|
||||
dispatch('keydown', {
|
||||
originalEvent: event,
|
||||
|
||||
Reference in New Issue
Block a user