feat: default to latest release channel if we dont have it set

pull/3281/head
yougotwill 2 months ago
parent ea47d05044
commit 8892e319df

@ -33,11 +33,8 @@ export const ReleaseChannel = () => {
const changeReleaseChannel = (channel: ReleaseChannels) => { const changeReleaseChannel = (channel: ReleaseChannels) => {
window.log.debug( window.log.debug(
`WIP: [debugMenu] release channel to ${channel} was ${Storage.get('releaseChannel') || 'not set'}` `WIP: [debugMenu] Setting release channel to ${channel}. It was ${Storage.get('releaseChannel') || 'not set'}`
); );
if (Storage.get('releaseChannel') === channel) {
return;
}
dispatch( dispatch(
updateConfirmModal({ updateConfirmModal({
title: localize('warning').toString(), title: localize('warning').toString(),
@ -49,7 +46,7 @@ export const ReleaseChannel = () => {
await Storage.put('releaseChannel', channel); await Storage.put('releaseChannel', channel);
} catch (error) { } catch (error) {
window.log.warn( window.log.warn(
`[debugMenu] Something went wrong when changing the release channel to ${channel} was ${Storage.get('releaseChannel') || 'not set'}:`, `[debugMenu] Something went wrong when setting the release channel to ${channel}. It was ${Storage.get('releaseChannel') || 'not set'}:`,
error && error.stack ? error.stack : error error && error.stack ? error.stack : error
); );
} finally { } finally {

@ -203,7 +203,7 @@ Storage.onready(async () => {
await Storage.put('version', currentVersion); await Storage.put('version', currentVersion);
if (newVersion) { if (newVersion) {
window.log.info(`New version detected: ${currentVersion}; previous: ${lastVersion}`); window.log.info(`[updater] New version detected: ${currentVersion}; previous: ${lastVersion}`);
await Data.cleanupOrphanedAttachments(); await Data.cleanupOrphanedAttachments();
} }

@ -141,7 +141,13 @@ export const getLatestReleaseFromFileServer = async (
ed25519SecretKey: userEd25519SecretKey, ed25519SecretKey: userEd25519SecretKey,
}); });
const method = 'GET'; const method = 'GET';
const releaseChannel = Storage.get('releaseChannel') as ReleaseChannels; let releaseChannel = Storage.get('releaseChannel') as ReleaseChannels;
if (!releaseChannel) {
releaseChannel = 'latest';
await Storage.put('releaseChannel', releaseChannel);
}
const endpoint = `${RELEASE_VERSION_ENDPOINT}?platform=desktop&os=${getOSPlatform()}&arch=${getOSArchitecture()}${releaseChannel ? `&release_channel=${releaseType || releaseChannel}` : ''}`; const endpoint = `${RELEASE_VERSION_ENDPOINT}?platform=desktop&os=${getOSPlatform()}&arch=${getOSArchitecture()}${releaseChannel ? `&release_channel=${releaseType || releaseChannel}` : ''}`;
const signature = await BlindingActions.blindVersionSignRequest({ const signature = await BlindingActions.blindVersionSignRequest({

Loading…
Cancel
Save