- All notifications are currently disabled for all devices.
+ All notifications are currently disabled for all targets.
);
}
+ var emailNotificationsRow;
+ if (this.props.threepids.filter(function(tp) {
+ if (tp.medium == "email") {
+ return true;
+ }
+ }).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+")"
+ );
+ }
+
// Build external push rules
var externalRules = [];
for (var i in this.state.externalPushRules) {
@@ -682,13 +742,11 @@ module.exports = React.createClass({
var devicesSection;
if (this.state.pushers === undefined) {
- devicesSection =
Unable to fetch device list
+ devicesSection =
Unable to fetch notification target list
} else if (this.state.pushers.length == 0) {
- devicesSection =
- No devices are receiving push notifications
-
+ devicesSection = null;
} else {
- // It would be great to be able to delete pushers from here too,
+ // TODO: It would be great to be able to delete pushers from here too,
// and this wouldn't be hard to add.
var rows = [];
for (var i = 0; i < this.state.pushers.length; ++i) {
@@ -698,17 +756,17 @@ module.exports = React.createClass({
);
}
devicesSection = (
-
-
-
Application
-
Device
-
-
{rows}
);
}
+ if (devicesSection) {
+ devicesSection = (
+
Notification targets
+ { devicesSection }
+
);
+ }
var advancedSettings;
if (externalRules.length) {
@@ -766,7 +824,7 @@ module.exports = React.createClass({
-