mirror of
https://github.com/element-hq/element-web
synced 2024-11-29 04:48:50 +03:00
confirm to close the passphrase dialog if it was done by backgroundClick
as it is easy to do by accident
This commit is contained in:
parent
c44ebef06f
commit
70a4d3415e
1 changed files with 17 additions and 0 deletions
|
@ -70,6 +70,7 @@ async function getSecretStorageKey({ keys: keyInfos }) {
|
||||||
sdk.getComponent("dialogs.secretstorage.AccessSecretStorageDialog");
|
sdk.getComponent("dialogs.secretstorage.AccessSecretStorageDialog");
|
||||||
const { finished } = Modal.createTrackedDialog("Access Secret Storage dialog", "",
|
const { finished } = Modal.createTrackedDialog("Access Secret Storage dialog", "",
|
||||||
AccessSecretStorageDialog,
|
AccessSecretStorageDialog,
|
||||||
|
/* props= */
|
||||||
{
|
{
|
||||||
keyInfo: info,
|
keyInfo: info,
|
||||||
checkPrivateKey: async (input) => {
|
checkPrivateKey: async (input) => {
|
||||||
|
@ -77,6 +78,22 @@ async function getSecretStorageKey({ keys: keyInfos }) {
|
||||||
return MatrixClientPeg.get().checkSecretStoragePrivateKey(key, info.pubkey);
|
return MatrixClientPeg.get().checkSecretStoragePrivateKey(key, info.pubkey);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
/* className= */ null,
|
||||||
|
/* isPriorityModal= */ false,
|
||||||
|
/* isStaticModal= */ false,
|
||||||
|
/* options= */ {
|
||||||
|
onBeforeClose: async (reason) => {
|
||||||
|
if (reason !== "backgroundClick") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
|
const [sure] = await Modal.createDialog(QuestionDialog, {
|
||||||
|
title: _t("Cancel entering passphrase?"),
|
||||||
|
description: _t("If you cancel now, you won't complete your SSSS operation!"),
|
||||||
|
}).finished;
|
||||||
|
return sure;
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
const [input] = await finished;
|
const [input] = await finished;
|
||||||
if (!input) {
|
if (!input) {
|
||||||
|
|
Loading…
Reference in a new issue