use getIn from utils for payload retrieval resilience
import { actionTypes } from "../actions/actions.js";
import Immutable from "immutable";
+import { getIn } from "../utils.js";
/* TODO this fragment is part of an attempt to sketch a different
* approach to asynchronity (Remove it or the thunk-based
@@ -55,8 +56,10 @@ export function messagesReducer(messages = initialState, action = {}) {
return messages.set("lostConnection", true).set("reconnecting", false);
case actionTypes.initialPageLoad: {
- const initialLoadFinished =
- action && action.getIn(["payload", "initialLoadFinished"]);
+ const initialLoadFinished = getIn(action, [
+ "payload",
+ "initialLoadFinished",
+ ]);
return initialLoadFinished
? messages.set("lostConnection", false).set("reconnecting", false)
: messages;
