Last active
June 11, 2019 20:48
-
-
Save Pinwheeler/589d6448ea0fe97c8d7545236f660aac to your computer and use it in GitHub Desktop.
State Change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_genericStateChange(nextAppState) { | |
this._stateChangeFromSource(nextAppState, 'generic') | |
} | |
async _universalLinksStateChange(nextAppState, route) { | |
await this._stateChangeFromSource(nextAppState, 'universal_link', route) | |
} | |
async _stateChangeFromSource(nextAppState, source, route = null) { | |
if (nextAppState === 'active') { | |
await this.updateApp() | |
if (source === 'universal_link') { | |
try { | |
let options = await route.navigationOptions() | |
Navigation.setStackRoot('CENTER_STACK', {component: options}) | |
this.AppState.removeEventListener('change', this._universalLinksStateChange) | |
} catch (error) { | |
console.log('_universalLinksStateChange', error) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment