feat: add read only mode for page in trash (#3440)

This commit is contained in:
JimmFly
2023-07-28 23:01:10 +08:00
committed by GitHub
parent ed8b2d9927
commit d96263fde9
2 changed files with 11 additions and 3 deletions

View File

@@ -57,6 +57,11 @@ export function usePageMetaHelper(blockSuiteWorkspace: Workspace) {
});
blockSuiteWorkspace.meta.setPageMeta(pageId, { title: newTitle });
},
setPageReadonly: (pageId: string, readonly: boolean) => {
const page = blockSuiteWorkspace.getPage(pageId);
assertExists(page);
page.awarenessStore.setReadonly(page, readonly);
},
setPageMeta: (pageId: string, pageMeta: Partial<PageMeta>) => {
blockSuiteWorkspace.meta.setPageMeta(pageId, pageMeta);
},