mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-04 11:51:36 +02:00
Actually assign the promise
This commit is contained in:
parent
86f6136257
commit
39f460b636
@ -233,7 +233,7 @@ class Store extends ElectronStore<StoreData> {
|
||||
});
|
||||
}
|
||||
|
||||
private safeStorageReadyPromise?: Promise<unknown>;
|
||||
private safeStorageReadyPromise?: Promise<boolean>;
|
||||
public async safeStorageReady(): Promise<void> {
|
||||
if (!this.safeStorageReadyPromise) {
|
||||
throw new Error("prepareSafeStorage must be called before using storage methods");
|
||||
@ -283,6 +283,11 @@ class Store extends ElectronStore<StoreData> {
|
||||
* @returns true if safeStorage was initialised successfully or false if the app will be relaunched
|
||||
*/
|
||||
public async prepareSafeStorage(electronSession: Session): Promise<boolean> {
|
||||
this.safeStorageReadyPromise = this.reallyPrepareSafeStorage(electronSession);
|
||||
return this.safeStorageReadyPromise;
|
||||
}
|
||||
|
||||
private async reallyPrepareSafeStorage(electronSession: Session): Promise<boolean> {
|
||||
await app.whenReady();
|
||||
|
||||
// The backend the existing data is written with if any
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user