Skip to content

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

mobile: add disable reminder notifications button in settings.

ammarahm-ed08ad4643102d
diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsx
index 88ba337b4..736da2299 100644
--- a/apps/mobile/app/screens/settings/settings-data.tsx
+++ b/apps/mobile/app/screens/settings/settings-data.tsx
@@ -811,6 +811,31 @@ export const settingsGroups: SettingSection[] = [
notifNotes: !settings.notifNotes
});
}
+ },
+ {
+ id: "reminders",
+ type: "screen",
+ name: "Reminders",
+ icon: "clock-outline",
+ description: "Manage and configure reminders in app",
+ sections: [
+ {
+ id: "disable-reminders",
+ property: "disableReminderNotifications",
+ type: "switch",
+ name: "Turn off reminder notifications",
+ icon: "bell-cancel-outline",
+ onChange: (property) => {
+ if (property) {
+ Notifications.setupReminders();
+ } else {
+ Notifications.clearAllTriggers();
+ }
+ },
+ description:
+ "Disable reminder notifications on this device, this is useful when you have notesnook on multiple devices & want to recieve reminder notifications only on your primary device."
+ }
+ ]
}
]
},
diff --git a/apps/mobile/app/stores/index.ts b/apps/mobile/app/stores/index.ts
index cab851356..298ae4382 100644
--- a/apps/mobile/app/stores/index.ts
+++ b/apps/mobile/app/stores/index.ts
@@ -27,12 +27,16 @@ import { useNoteStore } from "./use-notes-store";
import { useTagStore } from "./use-tag-store";
import { useTrashStore } from "./use-trash-store";
import { useReminderStore } from "./use-reminder-store";
+import Notifications from "../services/notifications";
export function initAfterSync() {
useMenuStore.getState().setColorNotes();
useMenuStore.getState().setMenuPins();
Navigation.queueRoutesForUpdate(
...(Object.keys(Navigation.routeUpdateFunctions) as unknown as RouteName[])
);
+ // Whenever sync completes, try to reschedule
+ // any new/updated reminders.
+ Notifications.setupReminders();
}
export function initialize() {
diff --git a/apps/mobile/app/stores/use-setting-store.ts b/apps/mobile/app/stores/use-setting-store.ts
index 33be77fb4..23f2b2c92 100644
--- a/apps/mobile/app/stores/use-setting-store.ts
+++ b/apps/mobile/app/stores/use-setting-store.ts
@@ -65,6 +65,7 @@ export type Settings = {
doubleSpacedLines?: boolean;
disableAutoSync?: boolean;
disableSync?: boolean;
+ disableReminderNotifications?: boolean;
};
type DimensionsType = {
@@ -136,7 +137,8 @@ export const useSettingStore = create<SettingStore>((set) => ({
showBackupCompleteSheet: true,
sessionExpired: false,
version: null,
- doubleSpacedLines: true
+ doubleSpacedLines: true,
+ disableReminderNotifications: false
},
sheetKeyboardHandler: true,
fullscreen: false,