Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2025-04-15 17:08:11 +01:00
parent 4826d52465
commit 7bdd368f30
No known key found for this signature in database
GPG Key ID: A2B008A5F49F5D0D
2 changed files with 5 additions and 3 deletions

View File

@ -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,

View File

@ -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()) {