A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: add disable realtime sync option in settings
ammarahm-ed7b2de009a797
diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor.ts b/apps/mobile/app/screens/editor/tiptap/use-editor.tsindex 598387d90..dc7bac2e6 100644--- a/apps/mobile/app/screens/editor/tiptap/use-editor.ts+++ b/apps/mobile/app/screens/editor/tiptap/use-editor.ts@@ -51,6 +51,7 @@ import {post} from "./utils";import { EVENTS } from "@notesnook/core/common";+import SettingsService from "../../../services/settings";export const useEditor = (editorId = "",@@ -365,6 +366,7 @@ export const useEditor = (const onSyncComplete = useCallback(async (data: NoteType | Content) => {+ if (SettingsService.get().disableRealtimeSync) return;if (!data) return;const noteId = data.type === "tiptap" ? data.noteId : data.id;diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsxindex c17e8f807..ef5f7c67b 100644--- a/apps/mobile/app/screens/settings/settings-data.tsx+++ b/apps/mobile/app/screens/settings/settings-data.tsx@@ -404,6 +404,13 @@ export const settingsGroups: SettingSection[] = [type: "switch",property: "disableAutoSync"},+ {+ id: "disable-realtime-sync",+ name: "Disable realtime sync",+ description: "Turn off realtime sync in the editor.",+ type: "switch",+ property: "disableRealtimeSync"+ },{id: "disable-sync",name: "Disable syncing",diff --git a/apps/mobile/app/stores/use-setting-store.ts b/apps/mobile/app/stores/use-setting-store.tsindex b6448ebb5..ea6a0c085 100644--- a/apps/mobile/app/stores/use-setting-store.ts+++ b/apps/mobile/app/stores/use-setting-store.ts@@ -68,6 +68,7 @@ export type Settings = {reminderNotifications?: boolean;defaultSnoozeTime?: string;corsProxy: string;+ disableRealtimeSync?:boolean};type DimensionsType = {