mobile: ensure note is saved when change note

This commit is contained in:
ammarahm-ed
2023-04-05 02:05:52 +05:00
parent 71ecc05bd6
commit 156ce7e711
3 changed files with 41 additions and 23 deletions

View File

@@ -83,6 +83,7 @@ export function useEditorController(update: () => void): EditorController {
}, []);
const contentChange = useCallback((editor: Editor) => {
const currentSessionId = globalThis.sessionId;
post(EventTypes.contentchange);
if (!editor) return;
if (typeof timers.current.change === "number") {
@@ -90,7 +91,7 @@ export function useEditorController(update: () => void): EditorController {
}
timers.current.change = setTimeout(() => {
htmlContentRef.current = editor.getHTML();
post(EventTypes.content, htmlContentRef.current);
post(EventTypes.content, htmlContentRef.current, currentSessionId);
}, 300);
}, []);