diff --git a/src/domain/session/SessionStatusViewModel.js b/src/domain/session/SessionStatusViewModel.js index d6ce464c..9c1b6cde 100644 --- a/src/domain/session/SessionStatusViewModel.js +++ b/src/domain/session/SessionStatusViewModel.js @@ -142,10 +142,21 @@ export class SessionStatusViewModel extends ViewModel { async enterPassphrase(passphrase) { if (passphrase) { try { - await this._session.enableSecretStorage("recoverykey", passphrase); + await this._session.enableSecretStorage("passphrase", passphrase); } catch (err) { console.error(err); - alert(`Could not set up secret storage: ${err.message}`); + alert(`Could not set up secret storage with passphrase: ${err.message}`); + } + } + } + + async enterSecurityKey(securityKey) { + if (securityKey) { + try { + await this._session.enableSecretStorage("recoverykey", securityKey); + } catch (err) { + console.error(err); + alert(`Could not set up secret storage with securityKey: ${err.message}`); } } } diff --git a/src/ui/web/session/SessionStatusView.js b/src/ui/web/session/SessionStatusView.js index 0a4fea0e..a833c84e 100644 --- a/src/ui/web/session/SessionStatusView.js +++ b/src/ui/web/session/SessionStatusView.js @@ -26,7 +26,8 @@ export class SessionStatusView extends TemplateView { spinner(t, {hidden: vm => !vm.isWaiting}), t.p(vm => vm.statusLabel), t.if(vm => vm.isConnectNowShown, t.createTemplate(t => t.button({onClick: () => vm.connectNow()}, "Retry now"))), - t.if(vm => vm.isSecretStorageShown, t.createTemplate(t => t.button({onClick: () => vm.enterPassphrase(prompt("Security key"))}, "Enter security key"))), + t.if(vm => vm.isSecretStorageShown, t.createTemplate(t => t.button({onClick: () => vm.enterPassphrase(prompt("Passphrase"))}, "Enter passphrase"))), + t.if(vm => vm.isSecretStorageShown, t.createTemplate(t => t.button({onClick: () => vm.enterSecurityKey(prompt("Security key"))}, "Enter security key"))), window.DEBUG ? t.button({id: "showlogs"}, "Show logs") : "" ]); }