diff --git a/src/models/global.js b/src/models/global.js index ad47737cf8d9f5f4790e854b65d37b1e1208fabb..87d6e1a7ad646574527a4d130e3a4b270f367212 100644 --- a/src/models/global.js +++ b/src/models/global.js @@ -21,12 +21,17 @@ export default { payload: data, }); }, - *clearNotices(_, { put, select }) { + *clearNotices({ payload }, { put, select }) { const count = yield select(state => state.global.notices.length); yield put({ type: 'user/changeNotifyCount', payload: count, }); + + yield put({ + type: 'saveClearedNotices', + payload, + }); }, }, @@ -44,7 +49,7 @@ export default { fetchingNotices: false, }; }, - clearNotices(state, { payload }) { + saveClearedNotices(state, { payload }) { return { ...state, notices: state.notices.filter(item => item.type !== payload),