Skip to content

Commit 83b7f94

Browse files
committed
Don't show phone number as target for email notifs
Fixes element-hq#3518
1 parent d696196 commit 83b7f94

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎src/components/views/settings/Notifications.js‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -719,20 +719,17 @@ module.exports = React.createClass({
719719
);
720720
}
721721

722-
var emailNotificationsRow;
723-
if (this.props.threepids.filter(function(tp) {
724-
if (tp.medium == "email") {
725-
return true;
726-
}
727-
}).length == 0) {
722+
const emailThreepids = this.props.threepids.filter((tp) => tp.medium == "email");
723+
let emailNotificationsRow;
724+
if (emailThreepids.length == 0) {
728725
emailNotificationsRow = <div>
729726
Add an email address above to configure email notifications
730727
</div>;
731728
} else {
732729
// This only supports the first email address in your profile for now
733730
emailNotificationsRow = this.emailNotificationsRow(
734-
this.props.threepids[0].address,
735-
"Enable email notifications ("+this.props.threepids[0].address+")"
731+
emailThreepids[0].address,
732+
"Enable email notifications ("+emailThreepids[0].address+")"
736733
);
737734
}
738735

0 commit comments

Comments
 (0)