diff --git a/src/locales/en.json b/src/locales/en.json index bf3c0ba1..d4718c9b 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1958,6 +1958,9 @@ "terminalSettings": "Terminal", "hostSidebarSettings": "Host & Sidebar", "snippetsSettings": "Snippets", + "updateSettings": "Updates", + "disableUpdateCheck": "Disable Update Check", + "disableUpdateCheckDesc": "Stop checking for new versions on startup and dashboard. Reduces network requests.", "currentPassword": "Current Password", "passwordChangedSuccess": "Password changed successfully! Please log in again.", "failedToChangePassword": "Failed to change password. Please check your current password and try again.", diff --git a/src/ui/desktop/apps/dashboard/Dashboard.tsx b/src/ui/desktop/apps/dashboard/Dashboard.tsx index c597e03d..ba8c1fba 100644 --- a/src/ui/desktop/apps/dashboard/Dashboard.tsx +++ b/src/ui/desktop/apps/dashboard/Dashboard.tsx @@ -160,13 +160,16 @@ export function Dashboard({ const uptimeInfo = await getUptime(); setUptime(uptimeInfo.formatted); - const versionInfo = await getVersionInfo(); - setVersionText(`v${versionInfo.localVersion}`); - if ( - versionInfo.status === "up_to_date" || - versionInfo.status === "requires_update" - ) { - setVersionStatus(versionInfo.status); + const updateCheckDisabled = localStorage.getItem("disableUpdateCheck") === "true"; + if (!updateCheckDisabled) { + const versionInfo = await getVersionInfo(); + setVersionText(`v${versionInfo.localVersion}`); + if ( + versionInfo.status === "up_to_date" || + versionInfo.status === "requires_update" + ) { + setVersionStatus(versionInfo.status); + } } try { diff --git a/src/ui/desktop/user/ElectronVersionCheck.tsx b/src/ui/desktop/user/ElectronVersionCheck.tsx index 85a0cda3..3752136c 100644 --- a/src/ui/desktop/user/ElectronVersionCheck.tsx +++ b/src/ui/desktop/user/ElectronVersionCheck.tsx @@ -30,6 +30,11 @@ export function ElectronVersionCheck({ const lineColor = isDarkMode ? "#151517" : "#f9f9f9"; useEffect(() => { + const updateCheckDisabled = localStorage.getItem("disableUpdateCheck") === "true"; + if (updateCheckDisabled) { + onContinue(); + return; + } if (isElectron()) { checkForUpdates(); } else { diff --git a/src/ui/desktop/user/UserProfile.tsx b/src/ui/desktop/user/UserProfile.tsx index 61cd61c6..c41b3f18 100644 --- a/src/ui/desktop/user/UserProfile.tsx +++ b/src/ui/desktop/user/UserProfile.tsx @@ -133,6 +133,9 @@ export function UserProfile({ const saved = localStorage.getItem("showHostTags"); return saved !== null ? saved === "true" : true; }); + const [disableUpdateCheck, setDisableUpdateCheck] = useState( + localStorage.getItem("disableUpdateCheck") === "true", + ); const [userRoles, setUserRoles] = useState([]); useEffect(() => { @@ -212,6 +215,11 @@ export function UserProfile({ window.dispatchEvent(new Event("showHostTagsChanged")); }; + const handleDisableUpdateCheckToggle = (enabled: boolean) => { + setDisableUpdateCheck(enabled); + localStorage.setItem("disableUpdateCheck", enabled.toString()); + }; + const handleDeleteAccount = async (e: React.FormEvent) => { e.preventDefault(); setDeleteLoading(true); @@ -613,6 +621,28 @@ export function UserProfile({ + +
+

+ {t("profile.updateSettings")} +

+
+
+
+ +

+ {t("profile.disableUpdateCheckDesc")} +

+
+ +
+
+