mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
prevent autoupdater from setting release channel (#1396)
This commit is contained in:
+3
-12
@@ -46,24 +46,15 @@ export default class AppUpdater {
|
|||||||
|
|
||||||
const isBetaVersion = packageJson.version.includes('-beta');
|
const isBetaVersion = packageJson.version.includes('-beta');
|
||||||
const releaseChannel = store.get('release_channel');
|
const releaseChannel = store.get('release_channel');
|
||||||
const isNotConfigured = !releaseChannel;
|
|
||||||
|
|
||||||
console.log('Release channel: ', releaseChannel);
|
console.log('[AppUpdater] Release channel from store: ', releaseChannel);
|
||||||
console.log('Is beta version: ', isBetaVersion);
|
console.log('[AppUpdater] Is beta version: ', isBetaVersion);
|
||||||
|
|
||||||
if (isNotConfigured) {
|
|
||||||
console.log(
|
|
||||||
'Release channel not configured, setting to ',
|
|
||||||
isBetaVersion ? 'beta' : 'latest',
|
|
||||||
);
|
|
||||||
store.set('release_channel', isBetaVersion ? 'beta' : 'latest');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (releaseChannel === 'beta') {
|
if (releaseChannel === 'beta') {
|
||||||
autoUpdater.channel = 'beta';
|
autoUpdater.channel = 'beta';
|
||||||
autoUpdater.allowPrerelease = true;
|
autoUpdater.allowPrerelease = true;
|
||||||
autoUpdater.disableDifferentialDownload = true;
|
autoUpdater.disableDifferentialDownload = true;
|
||||||
} else if (releaseChannel === 'latest') {
|
} else {
|
||||||
autoUpdater.channel = 'latest';
|
autoUpdater.channel = 'latest';
|
||||||
autoUpdater.allowDowngrade = true;
|
autoUpdater.allowDowngrade = true;
|
||||||
autoUpdater.allowPrerelease = false;
|
autoUpdater.allowPrerelease = false;
|
||||||
|
|||||||
@@ -110,6 +110,15 @@ export const useSyncSettingsToMain = () => {
|
|||||||
JSON.stringify(mainValueNormalized) !== JSON.stringify(rendererValueNormalized)
|
JSON.stringify(mainValueNormalized) !== JSON.stringify(rendererValueNormalized)
|
||||||
) {
|
) {
|
||||||
hasDifferences = true;
|
hasDifferences = true;
|
||||||
|
|
||||||
|
logFn.warn(logMsg.system.settingsSynchronized, {
|
||||||
|
meta: {
|
||||||
|
mainStoreKey: mapping.mainStoreKey,
|
||||||
|
mainValue: mainValueNormalized,
|
||||||
|
rendererValue: rendererValueNormalized,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
localSettings.set(mapping.mainStoreKey, rendererValue);
|
localSettings.set(mapping.mainStoreKey, rendererValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user