Commit f81b65a3 authored by afc163's avatar afc163

Fix clear notices

parent 0f631ee7
...@@ -21,12 +21,17 @@ export default { ...@@ -21,12 +21,17 @@ export default {
payload: data, payload: data,
}); });
}, },
*clearNotices(_, { put, select }) { *clearNotices({ payload }, { put, select }) {
const count = yield select(state => state.global.notices.length); const count = yield select(state => state.global.notices.length);
yield put({ yield put({
type: 'user/changeNotifyCount', type: 'user/changeNotifyCount',
payload: count, payload: count,
}); });
yield put({
type: 'saveClearedNotices',
payload,
});
}, },
}, },
...@@ -44,7 +49,7 @@ export default { ...@@ -44,7 +49,7 @@ export default {
fetchingNotices: false, fetchingNotices: false,
}; };
}, },
clearNotices(state, { payload }) { saveClearedNotices(state, { payload }) {
return { return {
...state, ...state,
notices: state.notices.filter(item => item.type !== payload), notices: state.notices.filter(item => item.type !== payload),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment