Skip to content

Commit

Permalink
Reduce app startup time
Browse files Browse the repository at this point in the history
  • Loading branch information
terrysahaidak committed Jul 2, 2017
1 parent 79e3c60 commit 11a9182
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/modules/app.js
Expand Up @@ -43,24 +43,27 @@ export function init() {
return
}

dispatch(setupFayeEvents())
dispatch({ type: INITIALIZED, token })

rootNavigator.startAppWithScreen({screen: 'gm.Home', showDrawer: true})
// getting base current user's information
await dispatch(getCurrentUser())
await dispatch(initializeUi())

await Promise.all([
dispatch(getRooms()),
dispatch(setupFaye()),
dispatch(initializeUi()),
dispatch(getRooms())
])

rootNavigator.startAppWithScreen({screen: 'gm.Home', showDrawer: true})
dispatch(setupNetStatusListener())
// if you need debug room screen, just comment nevigation to 'hone'
// and uncomment navigation to 'room'
// dispatch(Navigation.resetTo({name: 'user', userId: '52ce7f4eed5ab0b3bf053782', username: 'blia'}))
// dispatch(Navigation.resetTo({name: 'room', roomId: '54774579db8155e6700d8cc6'}))
await dispatch(getSuggestedRooms())
await Promise.all([
dispatch(setupFayeEvents()),
dispatch(setupFaye()),
dispatch(getSuggestedRooms())
])
// dispatch(Navigation.resetTo({name: 'roomUsers', roomId: '56a41e0fe610378809bde160'}))
await dispatch(checkNewReleases())
} catch (error) {
Expand Down

0 comments on commit 11a9182

Please sign in to comment.