From 35efa47b35f02ba3e054d7d745b9511a7ec505c0 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Tue, 12 Mar 2019 03:36:02 +0800 Subject: [PATCH] fix channel mention when app is started from push notification (#2638) --- app/actions/views/channel.js | 6 +++--- app/actions/views/root.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/actions/views/channel.js b/app/actions/views/channel.js index d19c9f91b..6405db219 100644 --- a/app/actions/views/channel.js +++ b/app/actions/views/channel.js @@ -344,7 +344,7 @@ export function selectDefaultChannel(teamId) { }; } -export function handleSelectChannel(channelId) { +export function handleSelectChannel(channelId, fromPushNotification = false) { return async (dispatch, getState) => { const state = getState(); const channel = getChannel(state, channelId); @@ -375,8 +375,8 @@ export function handleSelectChannel(channelId) { }, ])); - dispatch(markChannelAsRead(channelId, sameChannel ? null : currentChannelId)); - dispatch(markChannelAsViewed(channelId, sameChannel ? null : currentChannelId)); + dispatch(markChannelAsRead(channelId, fromPushNotification || sameChannel ? null : currentChannelId)); + dispatch(markChannelAsViewed(channelId, fromPushNotification || sameChannel ? null : currentChannelId)); }; } diff --git a/app/actions/views/root.js b/app/actions/views/root.js index be5035e0a..f61096236 100644 --- a/app/actions/views/root.js +++ b/app/actions/views/root.js @@ -92,7 +92,7 @@ export function loadFromPushNotification(notification, startAppFromPushNotificat } else if (channelId !== currentChannelId) { // when the notification is from a channel other than the current channel dispatch(setChannelDisplayName('')); - dispatch(handleSelectChannel(channelId)); + dispatch(handleSelectChannel(channelId, true)); } }; }