Only check for updates if disableUpdateNag is false (#11405)

This commit is contained in:
Billy Biggs
2025-10-17 12:44:31 -07:00
committed by GitHub
parent 7c086fe55b
commit e4226b8a3e
3 changed files with 37 additions and 12 deletions

View File

@@ -8,6 +8,7 @@ import type { UpdateInfo } from 'update-notifier';
import updateNotifier from 'update-notifier';
import semver from 'semver';
import { getPackageJson } from '../../utils/package.js';
import type { LoadedSettings } from '../../config/settings.js';
export const FETCH_TIMEOUT_MS = 2000;
@@ -39,8 +40,13 @@ function getBestAvailableUpdate(
return semver.gt(stableVer, nightlyVer) ? stable : nightly;
}
export async function checkForUpdates(): Promise<UpdateObject | null> {
export async function checkForUpdates(
settings: LoadedSettings,
): Promise<UpdateObject | null> {
try {
if (settings.merged.general?.disableUpdateNag) {
return null;
}
// Skip update check when running from source (development mode)
if (process.env['DEV'] === 'true') {
return null;