mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
Merge branch 'develop' into feat/quick-search
This commit is contained in:
@@ -17,8 +17,6 @@ export type EditorHandlers = {
|
||||
query?: { [key: string]: string }
|
||||
) => Promise<boolean>;
|
||||
getPageMeta: (pageId: string) => PageMeta | void;
|
||||
deletePage: (pageId: string) => void;
|
||||
recyclePage: (pageId: string) => void;
|
||||
toggleDeletePage: (pageId: string) => void;
|
||||
favoritePage: (pageId: string) => void;
|
||||
unFavoritePage: (pageId: string) => void;
|
||||
|
||||
@@ -26,15 +26,10 @@ export const useEditorHandler = (workspace?: Workspace): EditorHandlers => {
|
||||
},
|
||||
});
|
||||
},
|
||||
deletePage: pageId => {
|
||||
workspace!.setPageMeta(pageId, { trash: true });
|
||||
},
|
||||
recyclePage: pageId => {
|
||||
workspace!.setPageMeta(pageId, { trash: false });
|
||||
},
|
||||
toggleDeletePage: pageId => {
|
||||
const pageMeta = workspace!.meta.pageMetas.find(p => p.id === pageId);
|
||||
if (pageMeta) {
|
||||
workspace!.meta.setPage(pageId, { trashDate: new Date().getTime() });
|
||||
workspace!.setPageMeta(pageId, { trash: !pageMeta.trash });
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user