Explorar o código

fixed clearNotices effects in global model (#266)

Reorder the process in "clearNotices"
Xiaoming Liu %!s(int64=8) %!d(string=hai) anos
pai
achega
51e1ffebdf
Modificáronse 1 ficheiros con 4 adicións e 5 borrados
  1. 4 5
      src/models/global.js

+ 4 - 5
src/models/global.js

@@ -22,16 +22,15 @@ export default {
       });
     },
     *clearNotices({ payload }, { put, select }) {
+      yield put({
+        type: 'saveClearedNotices',
+        payload,
+      });
       const count = yield select(state => state.global.notices.length);
       yield put({
         type: 'user/changeNotifyCount',
         payload: count,
       });
-
-      yield put({
-        type: 'saveClearedNotices',
-        payload,
-      });
     },
   },