Browse Source

clear notices count

pull/22/head
afc163 9 years ago
parent
commit
ab20621586
  1. 7
      src/models/global.js
  2. 9
      src/models/user.js

7
src/models/global.js

@ -21,6 +21,13 @@ export default {
payload: data,
});
},
*clearNotices(_, { put, select }) {
const count = yield select(state => state.global.notices.length);
yield put({
type: 'user/changeNotifyCount',
payload: count,
});
},
},
reducers: {

9
src/models/user.js

@ -53,5 +53,14 @@ export default {
currentUser: action.payload,
};
},
changeNotifyCount(state, action) {
return {
...state,
currentUser: {
...state.currentUser,
notifyCount: action.payload,
},
};
},
},
};

Loading…
Cancel
Save