mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-18 12:47:50 +01:00
feat: realtime & auto sync for all users (#944)
This commit is contained in:
@@ -109,6 +109,18 @@ export function useEditorController(update: () => void): EditorController {
|
||||
const value = message.value;
|
||||
global.sessionId = message.sessionId;
|
||||
switch (type) {
|
||||
case "native:updatehtml": {
|
||||
htmlContentRef.current = value;
|
||||
if (!editor) break;
|
||||
const { from, to } = editor.state.selection;
|
||||
editor?.commands.setContent(htmlContentRef.current, false);
|
||||
editor.commands.setTextSelection({
|
||||
from,
|
||||
to
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
case "native:html":
|
||||
htmlContentRef.current = value;
|
||||
update();
|
||||
|
||||
Reference in New Issue
Block a user