mirror of https://github.com/vector-im/riot-web
confirm to close the passphrase dialog if it was done by backgroundClick
as it is easy to do by accidentpull/21833/head
parent
c44ebef06f
commit
70a4d3415e
|
@ -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 New Issue