From 497ab0f2129b3cb20cf66f45f254f8c419e0f2fc Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 25 Jun 2020 14:52:59 +0100 Subject: [PATCH 1/2] Hopefully ake cancel dialog a bit less weird There's no design on how to fix this so I've switched the buttons and made the primary not a danger button. We could also try some different wording, eg. 'abort' rather than 'cancel' because with 'ancel' it's not clear if you're cancelling whatever you were trying to do or the dialog asking you if you want to cancel... Ideal might be to make the cancel button red but that means making it a separate button or adding support for doing so to DialogButtons, so not going to do that unless we're sure that's what we want. Fixes https://github.com/vector-im/riot-web/issues/14140 --- src/CrossSigningManager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CrossSigningManager.js b/src/CrossSigningManager.js index a80c91a59a..105f47c832 100644 --- a/src/CrossSigningManager.js +++ b/src/CrossSigningManager.js @@ -54,11 +54,11 @@ async function confirmToDismiss(name) { const [sure] = await Modal.createDialog(QuestionDialog, { title: _t("Cancel entering passphrase?"), description, - danger: true, - cancelButton: _t("Enter passphrase"), - button: _t("Cancel"), + danger: false, + button: _t("Enter passphrase"), + cancelButton: _t("Cancel"), }).finished; - return sure; + return !sure; } async function getSecretStorageKey({ keys: keyInfos }, ssssItemName) { From ac771f6a60ceed53a57a88cc742a903f20607846 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 6 Jul 2020 15:26:40 +0100 Subject: [PATCH 2/2] New copy on passphrase cancel dialog --- src/CrossSigningManager.js | 17 ++++------------- src/i18n/strings/en_EN.json | 8 +++----- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/CrossSigningManager.js b/src/CrossSigningManager.js index 105f47c832..a584a69d35 100644 --- a/src/CrossSigningManager.js +++ b/src/CrossSigningManager.js @@ -40,22 +40,13 @@ export class AccessCancelledError extends Error { } } -async function confirmToDismiss(name) { - let description; - if (name === "m.cross_signing.user_signing") { - description = _t("If you cancel now, you won't complete verifying the other user."); - } else if (name === "m.cross_signing.self_signing") { - description = _t("If you cancel now, you won't complete verifying your other session."); - } else { - description = _t("If you cancel now, you won't complete your operation."); - } - +async function confirmToDismiss() { const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); const [sure] = await Modal.createDialog(QuestionDialog, { title: _t("Cancel entering passphrase?"), - description, + description: _t("Are you sure you want to cancel entering passphrase?"), danger: false, - button: _t("Enter passphrase"), + button: _t("Go Back"), cancelButton: _t("Cancel"), }).finished; return !sure; @@ -102,7 +93,7 @@ async function getSecretStorageKey({ keys: keyInfos }, ssssItemName) { /* options= */ { onBeforeClose: async (reason) => { if (reason === "backgroundClick") { - return confirmToDismiss(ssssItemName); + return confirmToDismiss(); } return true; }, diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index b23264a297..e38a7f28fc 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -62,11 +62,9 @@ "Server may be unavailable, overloaded, or you hit a bug.": "Server may be unavailable, overloaded, or you hit a bug.", "The server does not support the room version specified.": "The server does not support the room version specified.", "Failure to create room": "Failure to create room", - "If you cancel now, you won't complete verifying the other user.": "If you cancel now, you won't complete verifying the other user.", - "If you cancel now, you won't complete verifying your other session.": "If you cancel now, you won't complete verifying your other session.", - "If you cancel now, you won't complete your operation.": "If you cancel now, you won't complete your operation.", "Cancel entering passphrase?": "Cancel entering passphrase?", - "Enter passphrase": "Enter passphrase", + "Are you sure you want to cancel entering passphrase?": "Are you sure you want to cancel entering passphrase?", + "Go Back": "Go Back", "Cancel": "Cancel", "Setting up keys": "Setting up keys", "Sun": "Sun", @@ -1851,7 +1849,6 @@ "Enter your Security Phrase or to continue.": "Enter your Security Phrase or to continue.", "Security Key": "Security Key", "Use your Security Key to continue.": "Use your Security Key to continue.", - "Go Back": "Go Back", "Restoring keys from backup": "Restoring keys from backup", "Fetching keys from server...": "Fetching keys from server...", "%(completed)s of %(total)s keys restored": "%(completed)s of %(total)s keys restored", @@ -2224,6 +2221,7 @@ "Export room keys": "Export room keys", "This process allows you to export the keys for messages you have received in encrypted rooms to a local file. You will then be able to import the file into another Matrix client in the future, so that client will also be able to decrypt these messages.": "This process allows you to export the keys for messages you have received in encrypted rooms to a local file. You will then be able to import the file into another Matrix client in the future, so that client will also be able to decrypt these messages.", "The exported file will allow anyone who can read it to decrypt any encrypted messages that you can see, so you should be careful to keep it secure. To help with this, you should enter a passphrase below, which will be used to encrypt the exported data. It will only be possible to import the data by using the same passphrase.": "The exported file will allow anyone who can read it to decrypt any encrypted messages that you can see, so you should be careful to keep it secure. To help with this, you should enter a passphrase below, which will be used to encrypt the exported data. It will only be possible to import the data by using the same passphrase.", + "Enter passphrase": "Enter passphrase", "Confirm passphrase": "Confirm passphrase", "Export": "Export", "Import room keys": "Import room keys",