From 83b7f94609aee1e352dbf425787ac5d603c7b25e Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 28 Mar 2017 16:24:54 +0100 Subject: [PATCH 1/2] Don't show phone number as target for email notifs Fixes https://github.com/vector-im/riot-web/issues/3518 --- src/components/views/settings/Notifications.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index b5fc2f3d..78bde820 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -719,20 +719,17 @@ module.exports = React.createClass({ ); } - var emailNotificationsRow; - if (this.props.threepids.filter(function(tp) { - if (tp.medium == "email") { - return true; - } - }).length == 0) { + const emailThreepids = this.props.threepids.filter((tp) => tp.medium == "email"); + let emailNotificationsRow; + if (emailThreepids.length == 0) { emailNotificationsRow =
Add an email address above to configure email notifications
; } else { // This only supports the first email address in your profile for now emailNotificationsRow = this.emailNotificationsRow( - this.props.threepids[0].address, - "Enable email notifications ("+this.props.threepids[0].address+")" + emailThreepids[0].address, + "Enable email notifications ("+emailThreepids[0].address+")" ); } From c72a49d22905ab3d348d85e0c760cf100411f35d Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 28 Mar 2017 16:34:35 +0100 Subject: [PATCH 2/2] More equalses --- src/components/views/settings/Notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index 78bde820..b685c1f3 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -719,9 +719,9 @@ module.exports = React.createClass({ ); } - const emailThreepids = this.props.threepids.filter((tp) => tp.medium == "email"); + const emailThreepids = this.props.threepids.filter((tp) => tp.medium === "email"); let emailNotificationsRow; - if (emailThreepids.length == 0) { + if (emailThreepids.length === 0) { emailNotificationsRow =
Add an email address above to configure email notifications
;