mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-10 11:13:48 +02:00
Remove analytics and add more update headers
This commit is contained in:
@@ -2,7 +2,6 @@ import type { WebsocketRequest } from '@yaakapp-internal/models';
|
||||
import { upsertWebsocketRequest as cmdUpsertWebsocketRequest } from '@yaakapp-internal/ws';
|
||||
import { differenceInMilliseconds } from 'date-fns';
|
||||
import { createFastMutation } from '../hooks/useFastMutation';
|
||||
import { trackEvent } from '../lib/analytics';
|
||||
import { router } from '../lib/router';
|
||||
|
||||
export const upsertWebsocketRequest = createFastMutation<
|
||||
@@ -16,12 +15,11 @@ export const upsertWebsocketRequest = createFastMutation<
|
||||
const isNew = differenceInMilliseconds(new Date(), request.createdAt + 'Z') < 100;
|
||||
|
||||
if (isNew) {
|
||||
trackEvent('websocket_request', 'create');
|
||||
await router.navigate({
|
||||
to: '/workspaces/$workspaceId',
|
||||
params: { workspaceId: request.workspaceId },
|
||||
search: (prev) => ({ ...prev, request_id: request.id }),
|
||||
});
|
||||
} else trackEvent('websocket_request', 'update');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user