mirror of
https://github.com/appwrite/console.git
synced 2026-04-07 19:17:46 +00:00
Track clear search
This commit is contained in:
@@ -344,5 +344,6 @@ export enum Submit {
|
||||
SiteActivateDeployment = 'submit_site_activate_deployment',
|
||||
RecordCreate = 'submit_dns_record_create',
|
||||
RecordUpdate = 'submit_dns_record_update',
|
||||
RecordDelete = 'submit_dns_record_delete'
|
||||
RecordDelete = 'submit_dns_record_delete',
|
||||
SearchClear = 'submit_clear_search'
|
||||
}
|
||||
|
||||
@@ -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