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)); } }; }