summaryrefslogtreecommitdiffstats
path: root/webapp/stores
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-08-29 09:52:59 -0400
committerChristopher Speller <crspeller@gmail.com>2016-08-29 09:52:59 -0400
commita76db5b84f661f1254da6d04af5100f858051bb4 (patch)
treeb2b931c24b0b3a2fe622a1e2129186612fc82200 /webapp/stores
parentd252e61c662479155081aeaf34fe0c6e4c3705d1 (diff)
downloadchat-a76db5b84f661f1254da6d04af5100f858051bb4.tar.gz
chat-a76db5b84f661f1254da6d04af5100f858051bb4.tar.bz2
chat-a76db5b84f661f1254da6d04af5100f858051bb4.zip
PLT-2074 Refactor desktop notification settings UI and add setting for duration (#3883)
* Refactor desktop notification settings UI and add setting for duration * Update en.json * Update desktop_notification_settings.jsx
Diffstat (limited to 'webapp/stores')
-rw-r--r--webapp/stores/notification_store.jsx17
1 files changed, 13 insertions, 4 deletions
diff --git a/webapp/stores/notification_store.jsx b/webapp/stores/notification_store.jsx
index 507954a10..c5122dd7a 100644
--- a/webapp/stores/notification_store.jsx
+++ b/webapp/stores/notification_store.jsx
@@ -79,17 +79,26 @@ class NotificationStoreClass extends EventEmitter {
notifyText = notifyText.substring(0, 49) + '...';
}
+ let body = '';
if (notifyText.length === 0) {
if (msgProps.image) {
- Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.uploadedImage', ' uploaded an image'), channel, teamId);
+ body = username + Utils.localizeMessage('channel_loader.uploadedImage', ' uploaded an image');
} else if (msgProps.otherFile) {
- Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.uploadedFile', ' uploaded a file'), channel, teamId);
+ body = Utils.localizeMessage('channel_loader.uploadedFile', ' uploaded a file');
} else {
- Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.something', ' did something new'), channel, teamId);
+ body = username + Utils.localizeMessage('channel_loader.something', ' did something new');
}
} else {
- Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.wrote', ' wrote: ') + notifyText, channel, teamId);
+ body = username + Utils.localizeMessage('channel_loader.wrote', ' wrote: ') + notifyText;
}
+
+ let duration = Constants.DEFAULT_NOTIFICATION_DURATION;
+ if (user.notify_props && user.notify_props.desktop_duration) {
+ duration = parseInt(user.notify_props.desktop_duration, 10) * 1000;
+ }
+
+ Utils.notifyMe(title, body, channel, teamId, duration);
+
if (!user.notify_props || user.notify_props.desktop_sound === 'true') {
Utils.ding();
}