From f6a982ed51492792b49cec5b0e4bbc950ea7b118 Mon Sep 17 00:00:00 2001 From: u-e Date: Fri, 17 May 2019 18:48:00 +0300 Subject: [PATCH] created a flag for outo routing --- src/screens/root/container/rootContainer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/screens/root/container/rootContainer.js b/src/screens/root/container/rootContainer.js index a2d4b8c41..92659f151 100644 --- a/src/screens/root/container/rootContainer.js +++ b/src/screens/root/container/rootContainer.js @@ -27,6 +27,7 @@ const RootContainer = () => (WrappedComponent) => { this.state = { wrappedComponentStates: null, appState: AppState.currentState, + isNotificationRouted: false, }; } @@ -202,8 +203,11 @@ const RootContainer = () => (WrappedComponent) => { } this.pushNavigationTimeout = setTimeout(() => { + const { isNotificationRouted } = this.state; + clearTimeout(this.pushNavigationTimeout); - navigation.navigate({ routeName, params, key }); + if (isNotificationRouted) navigation.navigate({ routeName, params, key }); + this.setState({ isNotificationRouted: true }); }, 4000); }, });