MM-38331: fixes opening notification while in threads (#5664)
Opening a notification while in threads didn't pop the threads screen, this commit fixes that.
This commit is contained in:
parent
69a65067c3
commit
308637be32
4 changed files with 7 additions and 2 deletions
|
|
@ -97,6 +97,7 @@ export function loadFromPushNotification(notification, isInitialNotification) {
|
|||
}
|
||||
|
||||
dispatch(handleSelectTeamAndChannel(teamId, channelId));
|
||||
dispatch(selectPost(''));
|
||||
|
||||
const {root_id: rootId} = notification.payload || {};
|
||||
if (isCollapsedThreadsEnabled(state) && rootId) {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ export default class ChannelBase extends PureComponent {
|
|||
showTermsOfService: PropTypes.bool,
|
||||
skipMetrics: PropTypes.bool,
|
||||
viewingGlobalThreads: PropTypes.bool,
|
||||
collapsedThreadsEnabled: PropTypes.bool.isRequired,
|
||||
selectedPost: PropTypes.shape({
|
||||
id: PropTypes.string.isRequired,
|
||||
channel_id: PropTypes.string.isRequired,
|
||||
|
|
@ -199,7 +200,7 @@ export default class ChannelBase extends PureComponent {
|
|||
loadChannels = (teamId) => {
|
||||
const {loadChannelsForTeam, selectInitialChannel} = this.props.actions;
|
||||
if (EphemeralStore.getStartFromNotification()) {
|
||||
if (this.props.selectedPost) {
|
||||
if (this.props.selectedPost && this.props.collapsedThreadsEnabled) {
|
||||
EventEmitter.emit('goToThread', this.props.selectedPost);
|
||||
}
|
||||
// eslint-disable-next-line no-console
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ describe('ChannelBase', () => {
|
|||
},
|
||||
componentId: channelBaseComponentId,
|
||||
theme: Preferences.THEMES.denim,
|
||||
collapsedThreadsEnabled: false,
|
||||
};
|
||||
const optionsForTheme = (theme) => {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ function mapStateToProps(state) {
|
|||
|
||||
const currentTeamId = currentTeam?.delete_at === 0 ? currentTeam?.id : '';
|
||||
const currentChannelId = currentTeam?.delete_at === 0 ? getCurrentChannelId(state) : '';
|
||||
const collapsedThreadsEnabled = isCollapsedThreadsEnabled(state);
|
||||
|
||||
return {
|
||||
currentChannelId,
|
||||
|
|
@ -48,10 +49,11 @@ function mapStateToProps(state) {
|
|||
isSupportedServer,
|
||||
isSystemAdmin,
|
||||
selectedPost: getSelectedPost(state),
|
||||
collapsedThreadsEnabled,
|
||||
showTermsOfService: shouldShowTermsOfService(state),
|
||||
teamName: currentTeam?.display_name,
|
||||
theme: getTheme(state),
|
||||
viewingGlobalThreads: isCollapsedThreadsEnabled(state) && getViewingGlobalThreads(state),
|
||||
viewingGlobalThreads: collapsedThreadsEnabled && getViewingGlobalThreads(state),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue