From 2fccde0e8dae564d9e52fdf4ea84d339276e8134 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 3 Nov 2020 23:09:23 +0000
Subject: [PATCH 1/2] Hide prompt to add email for notifications if 3pid ui
feature is off
---
src/components/views/settings/Notifications.js | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js
index cd87803d84..1337991dc3 100644
--- a/src/components/views/settings/Notifications.js
+++ b/src/components/views/settings/Notifications.js
@@ -31,6 +31,7 @@ import SdkConfig from "../../../SdkConfig";
import LabelledToggleSwitch from "../elements/LabelledToggleSwitch";
import AccessibleButton from "../elements/AccessibleButton";
import {SettingLevel} from "../../../settings/SettingLevel";
+import {UIFeature} from "../../../settings/UIFeature";
// TODO: this "view" component still has far too much application logic in it,
// which should be factored out to other files.
@@ -783,14 +784,14 @@ export default class Notifications extends React.Component {
const emailThreepids = this.state.threepids.filter((tp) => tp.medium === "email");
let emailNotificationsRows;
- if (emailThreepids.length === 0) {
- emailNotificationsRows =
- { _t('Add an email address to configure email notifications') }
-
;
- } else {
+ if (emailThreepids.length > 0) {
emailNotificationsRows = emailThreepids.map((threePid) => this.emailNotificationsRow(
threePid.address, `${_t('Enable email notifications')} (${threePid.address})`,
));
+ } else if (SettingsStore.getValue(UIFeature.ThirdPartyID)) {
+ emailNotificationsRows =
+ { _t('Add an email address to configure email notifications') }
+
;
}
// Build external push rules
From a51307af2565c4e735a55c70ecdd1d12b5a1b7b1 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 3 Nov 2020 23:25:06 +0000
Subject: [PATCH 2/2] i18n
---
src/i18n/strings/en_EN.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index a461937875..eea9503cba 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -708,8 +708,8 @@
"Enable notifications for this account": "Enable notifications for this account",
"Clear notifications": "Clear notifications",
"All notifications are currently disabled for all targets.": "All notifications are currently disabled for all targets.",
- "Add an email address to configure email notifications": "Add an email address to configure email notifications",
"Enable email notifications": "Enable email notifications",
+ "Add an email address to configure email notifications": "Add an email address to configure email notifications",
"Notifications on the following keywords follow rules which can’t be displayed here:": "Notifications on the following keywords follow rules which can’t be displayed here:",
"Unable to fetch notification target list": "Unable to fetch notification target list",
"Notification targets": "Notification targets",