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
3e68efc894
commit
26a30ce22b
@ -86,6 +86,7 @@ export class Store extends ElectronStore<{
|
||||
/**
|
||||
* Migrates keytar data to safeStorage,
|
||||
* 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> {
|
||||
if (this.has("safeStorage")) return;
|
||||
@ -157,12 +158,11 @@ export class Store extends ElectronStore<{
|
||||
*/
|
||||
public async deleteSecret(key: string): Promise<void> {
|
||||
await this.safeStorageReady();
|
||||
if (!safeStorage.isEncryptionAvailable()) {
|
||||
throw new Error("SafeStorage is not available");
|
||||
}
|
||||
|
||||
this.delete(this.getSecretStorageKey(key));
|
||||
await keytar.deletePassword(LEGACY_KEYTAR_SERVICE, key);
|
||||
await keytar.deletePassword(KEYTAR_SERVICE, key);
|
||||
if (safeStorage.isEncryptionAvailable()) {
|
||||
this.delete(this.getSecretStorageKey(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user