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

This commit is contained in:
Elias Nahum 2019-08-09 11:04:24 -04:00 committed by GitHub
parent 757e58f83b
commit 5869e1a110
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) => {