Fix pop thread screen when deleting the root post (#3093)

This commit is contained in:
Mattermost Build 2019-08-09 17:06:16 +02:00 committed by Elias Nahum
parent aceef20257
commit 41ddb5cc1a
2 changed files with 9 additions and 5 deletions

View file

@ -166,11 +166,14 @@ export function goToScreen(name, title, passProps = {}, options = {}) {
};
}
export function popTopScreen() {
export function popTopScreen(screenId) {
return () => {
const componentId = EphemeralStore.getNavigationTopComponentId();
Navigation.pop(componentId);
if (screenId) {
Navigation.pop(screenId);
} else {
const componentId = EphemeralStore.getNavigationTopComponentId();
Navigation.pop(componentId);
}
};
}

View file

@ -88,7 +88,8 @@ export default class ThreadBase extends PureComponent {
}
close = () => {
this.props.actions.popTopScreen();
const {actions, componentId} = this.props;
actions.popTopScreen(componentId);
};
handleAutoComplete = (value) => {