From f81b65a344e692f971b00381331b8ac3a9711a4c Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 25 Oct 2017 19:37:48 +0800 Subject: [PATCH] Fix clear notices --- src/models/global.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/models/global.js b/src/models/global.js index ad47737c..87d6e1a7 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), -- GitLab