New version startup: clear remote expiration, hydrate from remote config
This commit is contained in:
parent
2fe142b6d3
commit
9f1bd94627
1 changed files with 26 additions and 0 deletions
|
@ -678,6 +678,14 @@ export async function startApp(): Promise<void> {
|
||||||
`New version detected: ${currentVersion}; previous: ${lastVersion}`
|
`New version detected: ${currentVersion}; previous: ${lastVersion}`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const remoteBuildExpiration = window.storage.get('remoteBuildExpiration');
|
||||||
|
if (remoteBuildExpiration) {
|
||||||
|
window.log.info(
|
||||||
|
`Clearing remoteBuildExpiration. Previous value was ${remoteBuildExpiration}`
|
||||||
|
);
|
||||||
|
window.storage.remove('remoteBuildExpiration');
|
||||||
|
}
|
||||||
|
|
||||||
const themeSetting = window.Events.getThemeSetting();
|
const themeSetting = window.Events.getThemeSetting();
|
||||||
const newThemeSetting = mapOldThemeToNew(themeSetting);
|
const newThemeSetting = mapOldThemeToNew(themeSetting);
|
||||||
|
|
||||||
|
@ -1990,6 +1998,24 @@ export async function startApp(): Promise<void> {
|
||||||
// Force a re-fetch before we process our queue. We may want to turn on
|
// Force a re-fetch before we process our queue. We may want to turn on
|
||||||
// something which changes how we process incoming messages!
|
// something which changes how we process incoming messages!
|
||||||
await window.Signal.RemoteConfig.refreshRemoteConfig(server);
|
await window.Signal.RemoteConfig.refreshRemoteConfig(server);
|
||||||
|
|
||||||
|
const expiration = window.Signal.RemoteConfig.getValue(
|
||||||
|
'desktop.clientExpiration'
|
||||||
|
);
|
||||||
|
if (expiration) {
|
||||||
|
const remoteBuildExpirationTimestamp = window.Signal.Util.parseRemoteClientExpiration(
|
||||||
|
expiration as string
|
||||||
|
);
|
||||||
|
if (remoteBuildExpirationTimestamp) {
|
||||||
|
window.storage.put(
|
||||||
|
'remoteBuildExpiration',
|
||||||
|
remoteBuildExpirationTimestamp
|
||||||
|
);
|
||||||
|
window.reduxActions.expiration.hydrateExpirationStatus(
|
||||||
|
window.Signal.Util.hasExpired()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.log.error(
|
window.log.error(
|
||||||
'connect: Error refreshing remote config:',
|
'connect: Error refreshing remote config:',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue