mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
mobile: fix readonly mode
This commit is contained in:
@@ -102,7 +102,7 @@ const Editor = React.memo(
|
||||
useEffect(() => {
|
||||
const sub = [eSubscribeEvent("webview_reset", onError)];
|
||||
return () => {
|
||||
sub.forEach((s) => s.unsubscribe());
|
||||
sub.forEach((s) => s?.unsubscribe());
|
||||
};
|
||||
}, [onError]);
|
||||
|
||||
@@ -179,9 +179,8 @@ const ReadonlyButton = ({ editor }: { editor: useEditorType }) => {
|
||||
|
||||
const onPress = async () => {
|
||||
if (editor.note.current) {
|
||||
await db.notes.note(editor.note.current.id)?.readonly();
|
||||
editor.note.current = db.notes?.note(editor.note.current.id)?.data;
|
||||
|
||||
await db.notes.readonly(false, editor.note.current.id);
|
||||
editor.note.current = await db.notes?.note(editor.note.current.id);
|
||||
useEditorStore.getState().setReadonly(false);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user