Procházet zdrojové kódy

fixed clearNotices effects in global model (#266)

Reorder the process in "clearNotices"
Xiaoming Liu před 8 roky
rodič
revize
51e1ffebdf
1 změnil soubory, kde provedl 4 přidání a 5 odebrání
  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,
-      });
     },
   },