fix channel mention when app is started from push notification (#2638)

This commit is contained in:
Saturnino Abril 2019-03-12 03:36:02 +08:00 committed by Harrison Healey
parent c7dc992ac0
commit 35efa47b35
2 changed files with 4 additions and 4 deletions

View file

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

View file

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