Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): journal nav button icon (#8517)

forehalo4e640b4ffc12
diff --git a/packages/frontend/core/src/components/root-app-sidebar/journal-button.tsx b/packages/frontend/core/src/components/root-app-sidebar/journal-button.tsx
index 9da13c1678..b430229871 100644
--- a/packages/frontend/core/src/components/root-app-sidebar/journal-button.tsx
+++ b/packages/frontend/core/src/components/root-app-sidebar/journal-button.tsx
@@ -25,7 +25,8 @@ export const AppSidebarJournalButton = ({
const workbench = useService(WorkbenchService).workbench;
const location = useLiveData(workbench.location$);
const { openToday } = useJournalRouteHelper(docCollection);
- const { isJournal } = useJournalInfoHelper(location.pathname.split('/')[1]);
+ const maybeDocId = location.pathname.split('/')[1];
+ const { isJournal } = useJournalInfoHelper(maybeDocId);
const handleOpenToday = useCatchEventCallback(
(e: MouseEvent) => {
@@ -35,7 +36,7 @@ export const AppSidebarJournalButton = ({
);
const JournalIcon = useLiveData(
- docDisplayMetaService.icon$(docCollection.id, {
+ docDisplayMetaService.icon$(maybeDocId, {
compareDate: new Date(),
})
);