From 6cee1f87f2361f3c4b431190ae2df2b12a2157ef Mon Sep 17 00:00:00 2001 From: enahum Date: Mon, 6 Jun 2016 10:46:09 -0300 Subject: PLT-2990 Clicking on a desktop notification from another team opens the team (#3253) --- webapp/stores/notification_store.jsx | 9 +++++---- webapp/stores/team_store.jsx | 9 +++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'webapp/stores') diff --git a/webapp/stores/notification_store.jsx b/webapp/stores/notification_store.jsx index 202b24432..5935b876b 100644 --- a/webapp/stores/notification_store.jsx +++ b/webapp/stores/notification_store.jsx @@ -32,6 +32,7 @@ class NotificationStoreClass extends EventEmitter { if (msgProps.mentions) { mentions = JSON.parse(msgProps.mentions); } + const teamId = msgProps.team_id; const channel = ChannelStore.get(post.channel_id); const user = UserStore.getCurrentUser(); @@ -67,14 +68,14 @@ class NotificationStoreClass extends EventEmitter { if (notifyText.length === 0) { if (msgProps.image) { - Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.uploadedImage', ' uploaded an image'), channel); + Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.uploadedImage', ' uploaded an image'), channel, teamId); } else if (msgProps.otherFile) { - Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.uploadedFile', ' uploaded a file'), channel); + Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.uploadedFile', ' uploaded a file'), channel, teamId); } else { - Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.something', ' did something new'), channel); + Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.something', ' did something new'), channel, teamId); } } else { - Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.wrote', ' wrote: ') + notifyText, channel); + Utils.notifyMe(title, username + Utils.localizeMessage('channel_loader.wrote', ' wrote: ') + notifyText, channel, teamId); } if (!user.notify_props || user.notify_props.desktop_sound === 'true') { Utils.ding(); diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx index 210d5c211..f4d60ba74 100644 --- a/webapp/stores/team_store.jsx +++ b/webapp/stores/team_store.jsx @@ -109,6 +109,15 @@ class TeamStoreClass extends EventEmitter { return ''; } + getTeamUrl(id) { + const team = this.get(id); + if (team) { + return getWindowLocationOrigin() + '/' + team.name; + } + + return null; + } + saveTeam(team) { this.teams[team.id] = team; } -- cgit v1.2.3-1-g7c22