From c24b75fb7e9f276d8dfe39d0e7beac1fe6fe6763 Mon Sep 17 00:00:00 2001 From: Sacha Date: Fri, 12 Apr 2019 18:35:35 +0200 Subject: [PATCH] fix(mobile): fix change listen addrs after refactor Signed-off-by: Sacha --- .../components/Library/DebugStateBar.js | 10 ++--- .../common/components/Navigator/index.js | 37 ++++++++++--------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/client/react-native/common/components/Library/DebugStateBar.js b/client/react-native/common/components/Library/DebugStateBar.js index 9375d71010..09095007f3 100644 --- a/client/react-native/common/components/Library/DebugStateBar.js +++ b/client/react-native/common/components/Library/DebugStateBar.js @@ -18,11 +18,11 @@ class DebugStateBar extends PureComponent { constructor (props) { super(props) this.state = { - watchTime: 3000, + watchTime: 10000, listenAddrs: [], listenInterfaceAddrs: [], timeouted: false, - requestTimeout: 2000, + requestTimeout: 5000, listenAddrTimer: null, InterfaceAddrTimer: null, bertyColor: colors.lightGrey, @@ -169,7 +169,7 @@ class DebugStateBar extends PureComponent { let bleState = false if (listenAddrs.length > 0 && listenInterfaceAddrs.length > 0) { - listenInterfaceAddrs.forEach((v, i, arr) => { + listenAddrs.forEach((v, i, arr) => { try { const splited = v.split('/') if (splited[1] === 'ip4' && splited[2] !== '127.0.0.1') { @@ -179,8 +179,8 @@ class DebugStateBar extends PureComponent { daemonState = daemonStateValues.connected } if ( - splited[1] === 'ble' && - splited[2] !== '00000000-0000-0000-0000-000000000000' + splited[1] === 'ble' + // && splited[2] !== '00000000-0000-0000-0000-000000000000' ) { bleColor = colors.green bgBleColor = colors.green25 diff --git a/client/react-native/common/components/Navigator/index.js b/client/react-native/common/components/Navigator/index.js index 5edcb8da5e..bc3bb237b3 100644 --- a/client/react-native/common/components/Navigator/index.js +++ b/client/react-native/common/components/Navigator/index.js @@ -56,23 +56,25 @@ class Navigator extends PureComponent { const { navigation } = this.props return ( - { - if (Platform.OS !== 'web') { - this.navigation = navigation - NavigationService.setTopLevelNavigator(navigation) - } - }} - onNavigationStateChange={(prevState, currentState) => { - const currentRoute = getActiveRoute(currentState) - const prevRoute = getActiveRoute(prevState) - if (prevRoute !== currentRoute) { - CoreModule.setCurrentRoute(getURIFromRoute(currentRoute)) - this.setState(currentRoute) - } - }} - /> + + { + if (Platform.OS !== 'web') { + this.navigation = navigation + NavigationService.setTopLevelNavigator(navigation) + } + }} + onNavigationStateChange={(prevState, currentState) => { + const currentRoute = getActiveRoute(currentState) + const prevRoute = getActiveRoute(prevState) + if (prevRoute !== currentRoute) { + CoreModule.setCurrentRoute(getURIFromRoute(currentRoute)) + this.setState(currentRoute) + } + }} + /> + ) } } @@ -80,4 +82,3 @@ class Navigator extends PureComponent { export default (Platform.OS !== 'web' ? createAppContainer(Navigator) : Navigator) -