Skip to content

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

mobile: remove unused ignoreEdit handling

kashaf-ansari-dev28f2ffdbf707
diff --git a/apps/mobile/app/screens/editor/tiptap/types.ts b/apps/mobile/app/screens/editor/tiptap/types.ts
index 6778cc7b8..ca96340c9 100644
--- a/apps/mobile/app/screens/editor/tiptap/types.ts
+++ b/apps/mobile/app/screens/editor/tiptap/types.ts
@@ -90,7 +90,6 @@ export type SavePayload = {
data?: string;
type?: "tiptap";
sessionHistoryId?: number;
- ignoreEdit: boolean;
tabId: string;
pendingChanges?: boolean;
sourceNoteId?: string;
diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor-events.tsx b/apps/mobile/app/screens/editor/tiptap/use-editor-events.tsx
index 716963271..e1c8cac84 100644
--- a/apps/mobile/app/screens/editor/tiptap/use-editor-events.tsx
+++ b/apps/mobile/app/screens/editor/tiptap/use-editor-events.tsx
@@ -149,7 +149,7 @@ const showActionsheet = async () => {
}
};
-type ContentMessage = { html: string; ignoreEdit: boolean };
+type ContentMessage = { html: string };
export const useEditorEvents = (
editor: useEditorType,
@@ -422,7 +422,6 @@ export const useEditorEvents = (
noteId: saveNoteId,
sourceNoteId: editorMessage.noteId,
tabId: editorMessage.tabId,
- ignoreEdit: (editorMessage.value as ContentMessage).ignoreEdit,
pendingChanges: editorMessage.value?.pendingChanges,
pendingChangesAt: editorMessage.value?.pendingChangesAt
});
@@ -435,7 +434,6 @@ export const useEditorEvents = (
noteId: saveNoteId,
sourceNoteId: editorMessage.noteId,
tabId: editorMessage.tabId,
- ignoreEdit: false,
pendingChanges: editorMessage.value?.pendingChanges,
pendingChangesAt: editorMessage.value?.pendingChangesAt
});
diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor.ts b/apps/mobile/app/screens/editor/tiptap/use-editor.ts
index 3e24ee06a..53776bbca 100644
--- a/apps/mobile/app/screens/editor/tiptap/use-editor.ts
+++ b/apps/mobile/app/screens/editor/tiptap/use-editor.ts
@@ -260,7 +260,6 @@ export const useEditor = (
id,
data,
type,
- ignoreEdit,
sessionHistoryId: currentSessionHistoryId,
tabId,
pendingChanges,
@@ -343,11 +342,6 @@ export const useEditor = (
noteData.title = title;
- if (ignoreEdit) {
- DatabaseLogger.log("Ignoring edits...");
- noteData.dateEdited = note?.dateEdited;
- }
-
if (data) {
noteData.content = {
data: data,
@@ -984,7 +978,6 @@ export const useEditor = (
title,
content,
type,
- ignoreEdit,
noteId,
tabId,
pendingChanges,
@@ -995,7 +988,6 @@ export const useEditor = (
title?: string;
content?: string;
type: string;
- ignoreEdit: boolean;
tabId: string;
pendingChanges?: boolean;
sourceNoteId?: string;
@@ -1005,7 +997,6 @@ export const useEditor = (
`saveContent... title: ${!!title}, content: ${!!content}, noteId: ${noteId}`
);
if (
- ignoreEdit ||
lock.current ||
(currentLoadingNoteId.current &&
currentLoadingNoteId.current === noteId)
@@ -1014,7 +1005,6 @@ export const useEditor = (
lock.current: ${lock.current}
currentLoadingNoteId.current: ${currentLoadingNoteId.current}
- ignoreEdit: ${ignoreEdit}
`);
if (lock.current) {
setTimeout(() => {
@@ -1051,7 +1041,6 @@ export const useEditor = (
data: content,
type: "tiptap",
id: noteId,
- ignoreEdit,
sessionHistoryId: noteId ? editorSessionHistory.get(noteId) : undefined,
tabId: tabId,
pendingChanges,
@@ -1080,7 +1069,7 @@ export const useEditor = (
saveNote(params);
}
},
- ignoreEdit ? 0 : 150
+ 150
);
},
[editorSessionHistory, withTimer, onChange, saveNote]