Restore remote config before connecting to server

This commit is contained in:
Sergey Skrobotov 2024-08-07 16:36:11 -07:00 committed by GitHub
parent abcf392e55
commit 7a9e51f5ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -57,8 +57,12 @@ type ConfigListenersMapType = {
let config: ConfigMapType = {};
const listeners: ConfigListenersMapType = {};
export async function initRemoteConfig(server: WebAPIType): Promise<void> {
export function restoreRemoteConfigFromStorage(): void {
config = window.storage.get('remoteConfig') || {};
}
export async function initRemoteConfig(server: WebAPIType): Promise<void> {
restoreRemoteConfigFromStorage();
await maybeRefreshRemoteConfig(server);
}