Allow links to open if home is already focused
这个提交包含在:
父节点
6a6049220d
当前提交
a54493a23f
共有 1 个文件被更改,包括 7 次插入 和 1 次删除
|
|
@ -77,7 +77,13 @@ class HomeScreen extends React.Component<Props> {
|
|||
headerRight: this.getHeaderButton,
|
||||
});
|
||||
}
|
||||
// TODO if already on home screen
|
||||
// Handle link open when home is focused
|
||||
this.props.navigation.addListener('state', this.handleNavigationParams);
|
||||
// handle link open when home is not focused or created
|
||||
this.handleNavigationParams();
|
||||
};
|
||||
|
||||
handleNavigationParams = () => {
|
||||
if (this.props.route.params !== undefined) {
|
||||
if (this.props.route.params.shouldOpen !== undefined && this.props.route.params.shouldOpen) {
|
||||
this.props.navigation.navigate(this.props.route.params.nextScreen, this.props.route.params.data);
|
||||
|
|
|
|||
正在加载…
在新工单中引用