Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
feat(reducers/layout): remove APPLICATION_INIT handling
Browse files Browse the repository at this point in the history
feat(reducers/layout): remove APPLICATION_INIT handling
  • Loading branch information
Metnew committed Sep 17, 2017
1 parent 1e23aea commit be37230
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/common/reducers/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
UI_CLOSE_SIDEBAR,
UI_WINDOW_RESIZE
} from 'actions/layout'
import {LOCATION_CHANGE, APPLICATION_INIT} from 'actions/common'
import {LOCATION_CHANGE} from 'actions/common'
//
import type {LOCATION_CHANGE_TYPE, APPLICATION_INIT_TYPE} from 'actions/common'
import type {
Expand Down Expand Up @@ -42,12 +42,14 @@ export function layout (state: State = initialState, action: Action): State {
return {isMobileSM, isMobileXS, isMobile}
}
switch (action.type) {
case APPLICATION_INIT:
case UI_WINDOW_RESIZE:
case UI_WINDOW_RESIZE: {
const {innerWidth} = action.payload
const mobileStates = computeMobileStatuses(innerWidth)
return {
...state,
...computeMobileStatuses(action.payload.innerWidth)
...mobileStates
}
}
case UI_OPEN_SIDEBAR:
return {
...state,
Expand Down

0 comments on commit be37230

Please sign in to comment.