Created
June 11, 2019 20:50
-
-
Save Pinwheeler/3f3956625bee54c475bc8c12f182d8f0 to your computer and use it in GitHub Desktop.
handleOpenURL
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
async handleOpenURL(event) { | |
const route = UniversalRoutes.findLink(event.url, new APIClient()) | |
if (this.AppState.currentState === 'active') { | |
let options = await route.navigationOptions() | |
Navigation.setStackRoot('CENTER_STACK', {component: options}) | |
} else { | |
const f = nextState => { | |
// allows us to not have to hold on to route as state | |
this.AppState.removeEventListener('change', f) | |
return this._universalLinksStateChange(nextState, route) | |
} | |
this.AppState.addEventListener('change', f) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment