batch actions dispatched when daemon is ready
This commit is contained in:
parent
279f6ff76c
commit
666674888e
1 changed files with 10 additions and 5 deletions
|
@ -8,6 +8,7 @@ import SplashScreen from 'component/splash.js';
|
|||
import SnackBar from 'component/snack-bar.js';
|
||||
import {AuthOverlay} from 'component/auth.js';
|
||||
import { Provider } from 'react-redux';
|
||||
import batchActions from 'util/batchActions'
|
||||
import store from 'store.js';
|
||||
import {
|
||||
doChangePath,
|
||||
|
@ -76,12 +77,16 @@ const initialState = app.store.getState();
|
|||
var init = function() {
|
||||
|
||||
function onDaemonReady() {
|
||||
app.store.dispatch(doDaemonReady())
|
||||
window.sessionStorage.setItem('loaded', 'y'); //once we've made it here once per session, we don't need to show splash again
|
||||
app.store.dispatch(doHistoryPush({}, "" +
|
||||
"Discover", "/discover"))
|
||||
app.store.dispatch(doFetchDaemonSettings())
|
||||
app.store.dispatch(doFileList())
|
||||
const actions = []
|
||||
|
||||
actions.push(doDaemonReady())
|
||||
actions.push(doChangePath('/discover'))
|
||||
actions.push(doFetchDaemonSettings())
|
||||
actions.push(doFileList())
|
||||
|
||||
app.store.dispatch(batchActions(actions))
|
||||
|
||||
ReactDOM.render(<Provider store={store}><div>{ lbryio.enabled ? <AuthOverlay/> : '' }<App /><SnackBar /></div></Provider>, canvas)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue