Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix editor loaded with incorrect config

Ammar Ahmed254a678d495f
diff --git a/apps/mobile/src/components/listitems/note/wrapper.js b/apps/mobile/src/components/listitems/note/wrapper.js
index 941225781..32851a8dc 100644
--- a/apps/mobile/src/components/listitems/note/wrapper.js
+++ b/apps/mobile/src/components/listitems/note/wrapper.js
@@ -44,7 +44,7 @@ export const openNote = async (item, isTrash, setSelectedItem) => {
history.selectedItemsList = [];
}
- if (!_note.conflicted) {
+ if (_note.conflicted) {
eSendEvent(eShowMergeDialog, _note);
return;
}
diff --git a/apps/mobile/src/screens/editor/index.tsx b/apps/mobile/src/screens/editor/index.tsx
index faa8a58f7..20bd0398c 100755
--- a/apps/mobile/src/screens/editor/index.tsx
+++ b/apps/mobile/src/screens/editor/index.tsx
@@ -26,9 +26,20 @@ const onShouldStartLoadWithRequest = (request: ShouldStartLoadRequest) => {
};
const Editor = React.memo(
- ({ readonly, noToolbar, noHeader, withController, editorId, onLoad }: EditorProps) => {
+ ({
+ readonly = false,
+ noToolbar = false,
+ noHeader = false,
+ withController = true,
+ editorId = '',
+ onLoad
+ }: EditorProps) => {
const editor = useEditor(editorId || '', readonly);
- const onMessage = useEditorEvents(editor, { readonly, noToolbar, noHeader });
+ const onMessage = useEditorEvents(editor, {
+ readonly,
+ noToolbar,
+ noHeader
+ });
const onMediaDownloaded = ({
hash,
@@ -75,10 +86,10 @@ const Editor = React.memo(
nestedScrollEnabled
onError={onError}
injectedJavaScriptBeforeContentLoaded={`
- globalThis.readonly=${readonly};
- globalThis.noToolbar=${noToolbar};
- globalThis.noHeader=${noHeader};
- `}
+ globalThis.readonly=${readonly};
+ globalThis.noToolbar=${noToolbar};
+ globalThis.noHeader=${noHeader};
+ `}
injectedJavaScript={`
globalThis.sessionId="${editor.sessionId}";`}
javaScriptEnabled={true}
diff --git a/apps/mobile/src/screens/editor/tiptap/useEditorEvents.ts b/apps/mobile/src/screens/editor/tiptap/useEditorEvents.ts
index 9e515be83..b34e5b66a 100644
--- a/apps/mobile/src/screens/editor/tiptap/useEditorEvents.ts
+++ b/apps/mobile/src/screens/editor/tiptap/useEditorEvents.ts
@@ -123,7 +123,6 @@ export const useEditorEvents = (editor: useEditorType, editorProps: Partial<Edit
if (!editor) return null;
useEffect(() => {
- console.log('setting settings');
editor.commands.setSettings({
deviceMode: deviceMode || 'mobile',
fullscreen: fullscreen,