mobile: add option to disable auto update check

This commit is contained in:
Ammar Ahmed
2025-05-16 10:55:31 +05:00
committed by Abdullah Atta
parent 3ecc43d976
commit 0fec38610c
6 changed files with 1721 additions and 1686 deletions

View File

@@ -341,8 +341,15 @@ const doAppLoadActions = async () => {
}; };
const checkAppUpdateAvailable = async () => { const checkAppUpdateAvailable = async () => {
if (__DEV__ || Config.isTesting === "true" || Config.FDROID_BUILD || BETA) if (
__DEV__ ||
Config.isTesting === "true" ||
Config.FDROID_BUILD ||
BETA ||
!SettingsService.getProperty("checkForUpdates")
)
return; return;
try { try {
const version = const version =
Config.GITHUB_RELEASE === "true" Config.GITHUB_RELEASE === "true"

View File

@@ -670,6 +670,13 @@ export const settingsGroups: SettingSection[] = [
}); });
}, },
disabled: () => !db.settings.getDefaultNotebook() disabled: () => !db.settings.getDefaultNotebook()
},
{
id: "disable-update-check",
type: "switch",
name: strings.autoUpdateCheck(),
description: strings.autoUpdateCheckDesc(),
property: "checkForUpdates"
} }
] ]
}, },

View File

@@ -98,6 +98,7 @@ export type Settings = {
lastFullBackupDate?: number; lastFullBackupDate?: number;
serverUrls?: Record<HostId, string>; serverUrls?: Record<HostId, string>;
defaultSidebarTab: number; defaultSidebarTab: number;
checkForUpdates?: boolean;
}; };
type DimensionsType = { type DimensionsType = {
@@ -196,7 +197,8 @@ export const defaultSettings: SettingStore["settings"] = {
settingsVersion: 0, settingsVersion: 0,
backupType: "partial", backupType: "partial",
fullBackupReminder: "never", fullBackupReminder: "never",
lastFullBackupDate: 0 lastFullBackupDate: 0,
checkForUpdates: true
}; };
export const useSettingStore = create<SettingStore>((set, get) => ({ export const useSettingStore = create<SettingStore>((set, get) => ({

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1285,6 +1285,9 @@ $headline$: Use starting line of the note as title.`,
roadmapDesc: () => t`See what the future of Notesnook is going to be like.`, roadmapDesc: () => t`See what the future of Notesnook is going to be like.`,
checkForUpdates: () => t`Check for updates`, checkForUpdates: () => t`Check for updates`,
checkForUpdatesDesc: () => t`Check for new version of Notesnook`, checkForUpdatesDesc: () => t`Check for new version of Notesnook`,
autoUpdateCheck: () => t`Check for updates automatically`,
autoUpdateCheckDesc: () =>
t`Check for new version of the app available on app launch`,
appVersion: () => t`App version`, appVersion: () => t`App version`,
defaultSound: () => t`Default sound`, defaultSound: () => t`Default sound`,
subNotSupported: () => subNotSupported: () =>