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

pull/3281/head
yougotwill 1 month ago
parent ea47d05044
commit 8892e319df

@ -33,11 +33,8 @@ export const ReleaseChannel = () => {
const changeReleaseChannel = (channel: ReleaseChannels) => {
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(
updateConfirmModal({
title: localize('warning').toString(),
@ -49,7 +46,7 @@ export const ReleaseChannel = () => {
await Storage.put('releaseChannel', channel);
} catch (error) {
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
);
} finally {

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

@ -141,7 +141,13 @@ export const getLatestReleaseFromFileServer = async (
ed25519SecretKey: userEd25519SecretKey,
});
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 signature = await BlindingActions.blindVersionSignRequest({

Loading…
Cancel
Save