feat(core): add journal navigation tracking (#8046)

fix AF-1314
This commit is contained in:
pengx17
2024-09-05 02:31:57 +00:00
parent 06552a1120
commit 1cac2f6ccd
3 changed files with 15 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import { DocsService, initEmptyPage, useService } from '@toeverything/infra';
import dayjs from 'dayjs';
import { useCallback, useMemo } from 'react';
import { track } from '../mixpanel';
import { WorkbenchService } from '../modules/workbench';
import type { DocCollection } from '../shared';
import { useCurrentWorkspacePropertiesAdapter } from './use-affine-adapter';
@@ -164,6 +165,9 @@ export const useJournalRouteHelper = (docCollection: DocCollection) => {
workbench.openDoc(page.id, {
at: newTab ? 'new-tab' : 'active',
});
track.$.navigationPanel.journal.navigate({
to: 'journal',
});
return page.id;
},
[getJournalByDate, workbench]