Procházet zdrojové kódy

fix updating badge bug (#289)

fix bug in effects: fetchNotices, after fetching new notices, we should update notice count in user model.
Xiaoming Liu před 8 roky
rodič
revize
0e601d18df
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      src/models/global.js

+ 4 - 0
src/models/global.js

@@ -20,6 +20,10 @@ export default {
         type: 'saveNotices',
         type: 'saveNotices',
         payload: data,
         payload: data,
       });
       });
+      yield put({
+        type: 'user/changeNotifyCount',
+        payload: data.length,
+      });
     },
     },
     *clearNotices({ payload }, { put, select }) {
     *clearNotices({ payload }, { put, select }) {
       yield put({
       yield put({