فهرست منبع

Fix clear notices

afc163 8 سال پیش
والد
کامیت
f81b65a344
1فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 7 2
      src/models/global.js

+ 7 - 2
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),