mirror of
https://github.com/element-hq/element-desktop
synced 2025-04-21 09:03:56 +02:00
Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
4826d52465
commit
7bdd368f30
@ -449,6 +449,8 @@ app.on("ready", async () => {
|
||||
console.log("No update_base_url is defined: auto update is disabled");
|
||||
}
|
||||
|
||||
await store.safeStorageReady();
|
||||
|
||||
// Load the previous window state with fallback to defaults
|
||||
const mainWindowState = windowStateKeeper({
|
||||
defaultWidth: 1024,
|
||||
|
@ -74,9 +74,9 @@ class Store extends ElectronStore<{
|
||||
}
|
||||
|
||||
private whenSafeStorageReadyPromise?: Promise<void>;
|
||||
private safeStorageReady(): Promise<void> {
|
||||
public safeStorageReady(): Promise<void> {
|
||||
if (!this.whenSafeStorageReadyPromise) {
|
||||
this.whenSafeStorageReadyPromise = app.whenReady().then(() => this.migrate());
|
||||
this.whenSafeStorageReadyPromise = app.whenReady().then(() => this.migrateSecrets());
|
||||
}
|
||||
return this.whenSafeStorageReadyPromise;
|
||||
}
|
||||
@ -88,7 +88,7 @@ class Store extends ElectronStore<{
|
||||
* deletes data from legacy keytar but keeps it in the new keytar for downgrade compatibility.
|
||||
* @throws if safeStorage is not available.
|
||||
*/
|
||||
public async migrate(): Promise<void> {
|
||||
private async migrateSecrets(): Promise<void> {
|
||||
if (this.has("safeStorage")) return;
|
||||
console.info("Store migration: started");
|
||||
if (!safeStorage.isEncryptionAvailable()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user