mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-10 19:06:36 +00:00
Fix password incorrect check when restoring backup (#23525)
This commit is contained in:
parent
eaab47a667
commit
cd69c4c361
@ -194,8 +194,9 @@ class DialogRestoreBackup extends LitElement implements HassDialog {
|
||||
this._userPassword || this._backupEncryptionKey
|
||||
);
|
||||
} catch (e: any) {
|
||||
this._unsubscribe();
|
||||
await this._unsubscribe();
|
||||
if (e.code === "password_incorrect") {
|
||||
this._error = undefined;
|
||||
this._step = "encryption";
|
||||
} else {
|
||||
this._error = e.message;
|
||||
@ -229,9 +230,11 @@ class DialogRestoreBackup extends LitElement implements HassDialog {
|
||||
private _unsubscribe() {
|
||||
window.removeEventListener("connection-status", this._connectionStatus);
|
||||
if (this._unsub) {
|
||||
this._unsub.then((unsub) => unsub());
|
||||
const prom = this._unsub.then((unsub) => unsub());
|
||||
this._unsub = undefined;
|
||||
return prom;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private _restoreState() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user