|
|
|
@ -47,7 +47,7 @@ const GlobalModel: GlobalModelType = { |
|
|
|
payload: data, |
|
|
|
}); |
|
|
|
const unreadCount: number = yield select( |
|
|
|
(state: ConnectState) => state.global.notices.filter(item => !item.read).length, |
|
|
|
(state: ConnectState) => state.global.notices.filter((item) => !item.read).length, |
|
|
|
); |
|
|
|
yield put({ |
|
|
|
type: 'user/changeNotifyCount', |
|
|
|
@ -64,7 +64,7 @@ const GlobalModel: GlobalModelType = { |
|
|
|
}); |
|
|
|
const count: number = yield select((state: ConnectState) => state.global.notices.length); |
|
|
|
const unreadCount: number = yield select( |
|
|
|
(state: ConnectState) => state.global.notices.filter(item => !item.read).length, |
|
|
|
(state: ConnectState) => state.global.notices.filter((item) => !item.read).length, |
|
|
|
); |
|
|
|
yield put({ |
|
|
|
type: 'user/changeNotifyCount', |
|
|
|
@ -76,7 +76,7 @@ const GlobalModel: GlobalModelType = { |
|
|
|
}, |
|
|
|
*changeNoticeReadState({ payload }, { put, select }) { |
|
|
|
const notices: NoticeItem[] = yield select((state: ConnectState) => |
|
|
|
state.global.notices.map(item => { |
|
|
|
state.global.notices.map((item) => { |
|
|
|
const notice = { ...item }; |
|
|
|
if (notice.id === payload) { |
|
|
|
notice.read = true; |
|
|
|
@ -94,7 +94,7 @@ const GlobalModel: GlobalModelType = { |
|
|
|
type: 'user/changeNotifyCount', |
|
|
|
payload: { |
|
|
|
totalCount: notices.length, |
|
|
|
unreadCount: notices.filter(item => !item.read).length, |
|
|
|
unreadCount: notices.filter((item) => !item.read).length, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
|