import initialState from '../constants/initialState';
import { 
    LOGO_SPIN_STARTED, 
    LOGO_SPIN_ENDED, 
    PAGE_SCROLL_STARTED, 
    PAGE_SCROLL_ENDED,
    APP_INIT,
    ALERT_MESSAGE,
    PROVIDER_CHANGE,
    BOARD_CHANGE,

    HEADER_TOGGLED,
    NAVBAR_TOGGLED,

    THREAD_REQUESTED,
    THREAD_DESTROYED,

    BOARD_REQUESTED,
    BOARD_DESTROYED,

    HEADER_PANEL_OPENED,
    HEADER_PANEL_CLOSED

} from '../constants';

export default function (state = initialState.status, action) {
    switch (action.type) {

        // case APP_INIT:
        //     return Object.assign({}, state, {
        //         isMainPage: true
        //     })

        case PAGE_SCROLL_STARTED:
            return Object.assign({}, state, {
                isScrolling: true,
                currentPage: action.payload
            })
            
        case PAGE_SCROLL_ENDED:
            return Object.assign({}, state, {
                isScrolling: false,
                currentPage: action.payload
            })

        case HEADER_TOGGLED:
            return Object.assign({}, state, {
                isHeaderVisible: action.payload
            })

        case NAVBAR_TOGGLED:
            return Object.assign({}, state, {
                isNavbarOpen: action.payload
            })

        case PROVIDER_CHANGE:
            return Object.assign({}, state, {
                provider: action.payload
            })

        case BOARD_REQUESTED:
            return Object.assign({}, state, {
                boardID: action.payload
            })

        case THREAD_REQUESTED:
            return Object.assign({}, state, {
                threadID: action.payload
            })

        case ALERT_MESSAGE:
            return Object.assign({}, state, {
                alertMessage: action.payload
            })

        case THREAD_DESTROYED:
            return Object.assign({}, state, {
                threadID: null
            })

        case BOARD_DESTROYED:
            return Object.assign({}, state, {
                boardID: null
            })

        case HEADER_PANEL_OPENED:
            return Object.assign({}, state, {
                activeHeaderPanel: action.payload
            })

        case HEADER_PANEL_OPENED:
            return Object.assign({}, state, {
                activeHeaderPanel: null
            })

        default:
            return state
    }
}

@@ -160,20 +160,21 @@
     APP_
-INIT
+READY
 ,%0A    AL
@@ -528,19 +528,16 @@
 %0A       
- //
  case AP
@@ -542,462 +542,91 @@
 APP_
-INIT:%0A        //     return Object.assign(%7B%7D, state, %7B%0A        //         isMainPage: true%0A        //     %7D)%0A%0A        case PAGE_SCROLL_STARTED:%0A            return Object.assign(%7B%7D, state, %7B%0A                isScrolling: true,%0A                currentPage: action.payload%0A            %7D)%0A            %0A        case PAGE_SCROLL_ENDED:%0A            return Object.assign(%7B%7D, state, %7B%0A                isScrolling: false,%0A                currentPage: action.payload
+READY:%0A            return Object.assign(%7B%7D, state, %7B%0A                appReady: true
 %0A   

Add appReady, remove scroll actions