Browse Source

fixed clearNotices effects in global model (#266)

Reorder the process in "clearNotices"
Xiaoming Liu 8 years atrás
parent
commit
51e1ffebdf
1 changed files with 4 additions and 5 deletions
  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,
-      });
     },
   },