batch actions dispatched when daemon is ready

This commit is contained in:
6ea86b96 2017-05-22 21:18:24 +04:00
parent 279f6ff76c
commit 666674888e
No known key found for this signature in database
GPG key ID: B282D183E4931E8F

View file

@ -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)
}