Add a setting to disable the version update nag message (#5449)
This commit is contained in:
parent
8d5fa18893
commit
ae8a8f6062
3 changed files with 15 additions and 0 deletions
|
|
@ -111,6 +111,9 @@ export interface Settings {
|
||||||
// Setting for disabling auto-update.
|
// Setting for disabling auto-update.
|
||||||
disableAutoUpdate?: boolean;
|
disableAutoUpdate?: boolean;
|
||||||
|
|
||||||
|
// Setting for disabling the update nag message.
|
||||||
|
disableUpdateNag?: boolean;
|
||||||
|
|
||||||
memoryDiscoveryMaxDirs?: number;
|
memoryDiscoveryMaxDirs?: number;
|
||||||
dnsResolutionOrder?: DnsResolutionOrder;
|
dnsResolutionOrder?: DnsResolutionOrder;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,14 @@ describe('handleAutoUpdate', () => {
|
||||||
expect(mockSpawn).not.toHaveBeenCalled();
|
expect(mockSpawn).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should do nothing if update nag is disabled', () => {
|
||||||
|
mockSettings.merged.disableUpdateNag = true;
|
||||||
|
handleAutoUpdate(mockUpdateInfo, mockSettings, '/root', mockSpawn);
|
||||||
|
expect(mockGetInstallationInfo).not.toHaveBeenCalled();
|
||||||
|
expect(mockUpdateEventEmitter.emit).not.toHaveBeenCalled();
|
||||||
|
expect(mockSpawn).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
it('should emit "update-received" but not update if auto-updates are disabled', () => {
|
it('should emit "update-received" but not update if auto-updates are disabled', () => {
|
||||||
mockSettings.merged.disableAutoUpdate = true;
|
mockSettings.merged.disableAutoUpdate = true;
|
||||||
mockGetInstallationInfo.mockReturnValue({
|
mockGetInstallationInfo.mockReturnValue({
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,10 @@ export function handleAutoUpdate(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings.merged.disableUpdateNag) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const installationInfo = getInstallationInfo(
|
const installationInfo = getInstallationInfo(
|
||||||
projectRoot,
|
projectRoot,
|
||||||
settings.merged.disableAutoUpdate ?? false,
|
settings.merged.disableAutoUpdate ?? false,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue