diff --git a/ui/js/main.js b/ui/js/main.js index a67a021e9..d02a965fa 100644 --- a/ui/js/main.js +++ b/ui/js/main.js @@ -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(
{ lbryio.enabled ? : '' }
, canvas) }