diff --git a/app/index.html b/app/index.html index b3e050c9..8c3858e9 100644 --- a/app/index.html +++ b/app/index.html @@ -21,6 +21,6 @@
- + diff --git a/app/lib/actions/sessions.js b/app/lib/actions/sessions.js index f1212b03..92aa347c 100644 --- a/app/lib/actions/sessions.js +++ b/app/lib/actions/sessions.js @@ -22,15 +22,16 @@ import { export function addSession (uid) { return (dispatch, getState) => { const { sessions } = getState(); + + // normally this would be encoded as an effect + // but the `SESSION_ADD` action is pretty expensive + // and we want to get this out as soon as possible const initial = null == sessions.activeUid; - return dispatch({ + if (initial) rpc.emit('init'); + + dispatch({ type: SESSION_ADD, - uid, - effect () { - if (initial) { - rpc.emit('init'); - } - } + uid }); }; }