Add option to reset keys to the encryption setup screen

This commit is contained in:
David Baker 2020-06-02 17:55:27 +01:00
parent e06ba2003b
commit 5624cf5ceb
4 changed files with 50 additions and 2 deletions

View file

@ -81,6 +81,15 @@ export class SetupEncryptionStore extends EventEmitter {
this.emit("update");
}
async startKeyReset() {
try {
await accessSecretStorage(() => {}, {forceReset: true});
// If the keys are reset, the trust status event will fire and we'll change state
} catch (e) {
// dialog was cancelled - stay on the current screen
}
}
async useRecoveryKey() {
this.phase = PHASE_RECOVERY_KEY;
this.emit("update");