Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Not all actions are being saved. #179

@SLYtiger16

Description

@SLYtiger16

Despite the setup as below with no blacklisted or whitelisted actions, once I dispatch sertain actions all saving stops for the entire app.

const reducer = storage.reducer(combineReducers({
  menu: menuReducer,
  axios: axiosReducer,
  admin: combineReducers({
    storage: storageReducer,
    classes: classesReducer,
    classEdit: classEditReducer,
    classEditStudents: classEditStudentsReducer,
    deleteConfirm: deleteConfirmReducer,
    actionConfirm: actionConfirmReducer,
    saveDialog: saveDialogReducer,
    admins: adminsReducer,
    adminEdit: adminEditReducer,
    students: studentsReducer,
    studentView: studentViewReducer
  })
}));
const engine = createEngine('vs45tgfr5678ikhy');
const middleware = [thunk, storage.createMiddleware(engine)];
const store = createStore(
  reducer,
  applyMiddleware(...middleware)
);
const load = storage.createLoader(engine);
load(store);

load(store)
  .then((newState) => console.log('STATE LOADED FROM INDEXED D:', newState))
  .catch(() => console.log('Failed to load previous state from local db!'));

export default store;

Fails on anything dispatched in the deleteConfirm:

let initialState = {
    show: false,
    action: null,
    params: null,
    item: null
};

const deleteConfirmReducer = (state = initialState, action) => {
    let newState = {};
    let data = action.payload;

    switch (action.type) {
        case 'DELETE_CONFIRM_HIDE':
            newState = Object.assign({}, state);
            newState = {
                show: false,
                action: state.action,
                params: state.params,
                item: state.item
            };
            return newState;

        case 'DELETE_CONFIRM_UPDATE':
            newState = Object.assign({}, state);
            newState = {
                show: true,
                action: (!data.action) ? null : data.action,
                params: (!data.params) ? null : data.params,
                item: (!data.item) ? null : data.item
            };
            return newState;

        case 'DELETE_CONFIRM_RESET':
            newState = Object.assign({}, state);
            newState = {
                show: false,
                action: null,
                params: null,
                item: null
            };
            return newState;

        default:
            return state;
    }
};

export default deleteConfirmReducer;

I cannot seem to find anything as to why.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions