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