mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
feat(desktop): let users install updates on demand (#3487)
This commit is contained in:
1 parent
9213a765b1
commit
105bd49c9e
46 files changed
+477
-360
No files matched your search
@@ -13,9 +13,7 @@ const {getDesktopTroubleshootingSettings, loadDesktopConfig, setDesktopTroublesh
|
||||
'../common/DesktopConfig.ts'
|
||||
);
|
||||
const {shouldDisableModuleUpdatesForLaunch} = await import('./LaunchOptions.ts');
|
||||
const {areModuleUpdatesDisabled, resolveEffectiveDesktopTroubleshootingSettings} = await import(
|
||||
'./DesktopDebugInfo.ts'
|
||||
);
|
||||
const {isUpdateOnDemandLaunch, resolveEffectiveDesktopTroubleshootingSettings} = await import('./DesktopDebugInfo.ts');
|
||||
|
||||
function loadSettings(troubleshooting) {
|
||||
const userDataPath = fs.mkdtempSync(path.join(os.tmpdir(), 'fluxer-desktop-module-updates-setting-test-'));
|
||||
@@ -112,9 +110,25 @@ describe('disabling module updates', () => {
|
||||
test('keeps the launch answer when the persisted setting changes without a restart', () => {
|
||||
withModuleUpdatesEnv(undefined, () => {
|
||||
loadSettings({disableModuleUpdates: true});
|
||||
assert.equal(areModuleUpdatesDisabled(), true);
|
||||
assert.equal(isUpdateOnDemandLaunch(), true);
|
||||
setDesktopTroubleshootingSettings({disableModuleUpdates: false});
|
||||
assert.equal(areModuleUpdatesDisabled(), true);
|
||||
assert.equal(isUpdateOnDemandLaunch(), true);
|
||||
});
|
||||
});
|
||||
|
||||
test('the persisted setting moves updates on demand and leaves the in-app update check on', () => {
|
||||
withModuleUpdatesEnv(undefined, () => {
|
||||
loadSettings({disableModuleUpdates: true});
|
||||
assert.equal(isUpdateOnDemandLaunch(), true);
|
||||
assert.equal(shouldDisableModuleUpdatesForLaunch([]), false);
|
||||
});
|
||||
});
|
||||
|
||||
test('the environment variable turns updates off entirely, even with the setting on', () => {
|
||||
withModuleUpdatesEnv('1', () => {
|
||||
loadSettings({disableModuleUpdates: true});
|
||||
assert.equal(isUpdateOnDemandLaunch(), false);
|
||||
assert.equal(shouldDisableModuleUpdatesForLaunch([]), true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user