From 39f460b6363a062616581b5f655dcefbe4f8077e Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 4 Jun 2025 18:26:56 +0100 Subject: [PATCH] Actually assign the promise --- src/store.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/store.ts b/src/store.ts index 9517d84e67..c9b18fb843 100644 --- a/src/store.ts +++ b/src/store.ts @@ -233,7 +233,7 @@ class Store extends ElectronStore { }); } - private safeStorageReadyPromise?: Promise; + private safeStorageReadyPromise?: Promise; public async safeStorageReady(): Promise { if (!this.safeStorageReadyPromise) { throw new Error("prepareSafeStorage must be called before using storage methods"); @@ -283,6 +283,11 @@ class Store extends ElectronStore { * @returns true if safeStorage was initialised successfully or false if the app will be relaunched */ public async prepareSafeStorage(electronSession: Session): Promise { + this.safeStorageReadyPromise = this.reallyPrepareSafeStorage(electronSession); + return this.safeStorageReadyPromise; + } + + private async reallyPrepareSafeStorage(electronSession: Session): Promise { await app.whenReady(); // The backend the existing data is written with if any