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): fix page priority load (#6072)

EYHNeca35ded2f8c
diff --git a/packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx b/packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx
index 149f4c1078..497a4c984e 100644
--- a/packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx
+++ b/packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx
@@ -255,6 +255,7 @@ const DetailPageImpl = memo(function DetailPageImpl() {
});
export const DetailPage = ({ pageId }: { pageId: string }): ReactElement => {
+ const currentWorkspace = useService(Workspace);
const pageRecordList = useService(PageRecordList);
const pageListReady = useLiveData(pageRecordList.isReady);
@@ -281,6 +282,11 @@ export const DetailPage = ({ pageId }: { pageId: string }): ReactElement => {
};
}, [pageManager, pageRecord]);
+ // set sync engine priority target
+ useEffect(() => {
+ currentWorkspace.setPriorityRule(id => id.endsWith(pageId));
+ }, [currentWorkspace, pageId]);
+
const jumpOnce = useLiveData(pageRecord?.meta.map(meta => meta.jumpOnce));
useEffect(() => {