mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-18 20:49:36 +01:00
mobile: use editor state to check whether
content update is needed on item sync
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user