mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-08 13:46:16 +02:00
Move store creation into migration methods
This commit is contained in:
parent
e326246669
commit
63e1e0d894
@ -258,7 +258,6 @@ class Store extends ElectronStore<StoreData> {
|
||||
}
|
||||
|
||||
if (this.get("safeStorageBackendMigrate")) {
|
||||
this.secrets = new PlaintextStorageWriter(this);
|
||||
return this.upgradeLinuxBackend2();
|
||||
}
|
||||
|
||||
@ -322,7 +321,6 @@ class Store extends ElectronStore<StoreData> {
|
||||
if (safeStorageBackend === "basic_text") {
|
||||
return this.upgradeLinuxBackend1();
|
||||
} else if (safeStorageBackend === "plaintext") {
|
||||
this.secrets = new PlaintextStorageWriter(this);
|
||||
this.upgradeLinuxBackend3();
|
||||
} else if (safeStorageBackend in safeStorageBackendMap) {
|
||||
this.set("safeStorageBackendOverride", true);
|
||||
@ -383,7 +381,7 @@ class Store extends ElectronStore<StoreData> {
|
||||
relaunchApp();
|
||||
}
|
||||
private upgradeLinuxBackend2(): void {
|
||||
if (!this.secrets) throw new Error("safeStorage not ready");
|
||||
this.secrets = new PlaintextStorageWriter(this);
|
||||
console.info("Performing safeStorage migration");
|
||||
const data = this.get("safeStorage");
|
||||
if (data) {
|
||||
@ -396,7 +394,7 @@ class Store extends ElectronStore<StoreData> {
|
||||
relaunchApp();
|
||||
}
|
||||
private upgradeLinuxBackend3(): void {
|
||||
if (!this.secrets) throw new Error("safeStorage not ready");
|
||||
this.secrets = new PlaintextStorageWriter(this);
|
||||
const selectedSafeStorageBackend = safeStorage.getSelectedStorageBackend();
|
||||
console.info(`Finishing safeStorage migration to ${selectedSafeStorageBackend}`);
|
||||
const data = this.get("safeStorage");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user