mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 17:46:18 +08:00
feat: add readonly status in trash
This commit is contained in:
@@ -113,6 +113,11 @@ const EditorReactor = ({
|
||||
editor.mode = pageMeta.mode;
|
||||
}
|
||||
|
||||
if (pageMeta?.trash) {
|
||||
// @ts-ignore
|
||||
editor.readonly = true;
|
||||
}
|
||||
|
||||
setEditor(editor);
|
||||
}, [workspace, currentPage, setEditor]);
|
||||
|
||||
|
||||
@@ -42,6 +42,13 @@ export const useEditorHandler = ({
|
||||
trash: !pageMeta.trash,
|
||||
trashDate: +new Date(),
|
||||
});
|
||||
|
||||
if (pageMeta.trash) {
|
||||
toast('Removed to trash');
|
||||
const editor = document.querySelector('editor-container');
|
||||
// @ts-ignore
|
||||
editor?.setAttribute('readonly', 'false');
|
||||
}
|
||||
}
|
||||
},
|
||||
permanentlyDeletePage: pageId => {
|
||||
|
||||
Reference in New Issue
Block a user