Remove analytics and add more update headers

This commit is contained in:
Gregory Schier
2025-02-24 06:31:49 -08:00
parent af7782c93b
commit 05ac836265
62 changed files with 146 additions and 519 deletions

View File

@@ -1,7 +1,5 @@
import type { Workspace } from '@yaakapp-internal/models';
import { differenceInMilliseconds } from 'date-fns';
import { createFastMutation } from '../hooks/useFastMutation';
import { trackEvent } from '../lib/analytics';
import { invokeCmd } from '../lib/tauri';
export const upsertWorkspace = createFastMutation<
@@ -11,10 +9,4 @@ export const upsertWorkspace = createFastMutation<
>({
mutationKey: ['upsert_workspace'],
mutationFn: (workspace) => invokeCmd<Workspace>('cmd_update_workspace', { workspace }),
onSuccess: async (workspace) => {
const isNew = differenceInMilliseconds(new Date(), workspace.createdAt + 'Z') < 100;
if (isNew) trackEvent('workspace', 'create');
else trackEvent('workspace', 'update');
},
});