MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / changeNoticeReadState

Function changeNoticeReadState

src/models/global.js:46–69  ·  view source on GitHub ↗
({ payload }, { put, select })

Source from the content-addressed store, hash-verified

44 },
45
46 *changeNoticeReadState({ payload }, { put, select }) {
47 const notices = yield select(state =>
48 state.global.notices.map(item => {
49 const notice = { ...item };
50
51 if (notice.id === payload) {
52 notice.read = true;
53 }
54
55 return notice;
56 }),
57 );
58 yield put({
59 type: 'saveNotices',
60 payload: notices,
61 });
62 yield put({
63 type: 'user/changeNotifyCount',
64 payload: {
65 totalCount: notices.length,
66 unreadCount: notices.filter(item => !item.read).length,
67 },
68 });
69 },
70 },
71 reducers: {
72 changeRightDrawerVisible(state,{payload}){

Callers

nothing calls this directly

Calls 1

selectFunction · 0.85

Tested by

no test coverage detected