Set showSlideIns to true for certain cases (regardless of the showState beforehand): emailUnverified, connectionLoss, anonymousUser, tosNotAccepted
@@ -26,6 +26,9 @@ const initialState = Immutable.fromJS({
export default function(viewState = initialState, action = {}) {
switch (action.type) {
+ case actionTypes.lostConnection:
+ return viewState.set("showSlideIns", true);
+
case actionTypes.view.toggleSlideIns:
return viewState.set("showSlideIns", !viewState.get("showSlideIns"));
@@ -35,8 +38,20 @@ export default function(viewState = initialState, action = {}) {
case actionTypes.account.store:
case actionTypes.account.reset:
- case actionTypes.view.hideMainMenu:
+ case actionTypes.view.hideMainMenu: {
+ const emailVerified = action.payload.get("emailVerified");
+ const acceptedTermsOfService = action.payload.get(
+ "acceptedTermsOfService"
+ );
+
+ const isAnonymous = action.payload.get("isAnonymous");
+
+ if (isAnonymous || !emailVerified || !acceptedTermsOfService) {
+ viewState = viewState.set("showSlideIns", true);
+ }
+
return viewState.set("showMainMenu", false);
+ }
case actionTypes.view.toggleRdf:
return viewState
