mobile: use editor state to check whether

content update is needed on item sync
This commit is contained in:
ammarahm-ed
2022-12-05 17:54:19 +05:00
parent eaace54154
commit 64bf627462
4 changed files with 32 additions and 15 deletions

View File

@@ -77,10 +77,12 @@ export function useEditorController(update: () => void): EditorController {
const selectionChange = useCallback((_editor: Editor) => {}, []);
const titleChange = useCallback((title: string) => {
post(EventTypes.contentchange);
post(EventTypes.title, title);
}, []);
const contentChange = useCallback((editor: Editor) => {
post(EventTypes.contentchange);
if (!editor) return;
if (typeof timers.current.change === "number") {
clearTimeout(timers.current?.change);