Przeglądaj źródła

fixed clearNotices effects in global model (#266)

Reorder the process in "clearNotices"
Xiaoming Liu 8 lat temu
rodzic
commit
51e1ffebdf
1 zmienionych plików z 4 dodań i 5 usunięć
  1. 4 5
      src/models/global.js

+ 4 - 5
src/models/global.js

@@ -22,16 +22,15 @@ export default {
       });
       });
     },
     },
     *clearNotices({ payload }, { put, select }) {
     *clearNotices({ payload }, { put, select }) {
+      yield put({
+        type: 'saveClearedNotices',
+        payload,
+      });
       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,
-      });
     },
     },
   },
   },