F 修复通知未读数量错误计算的问题

pull/31/head
vapao 2020-02-28 00:55:35 +08:00
parent 5cd87277d5
commit 2f7270cfef
1 changed files with 5 additions and 3 deletions

View File

@ -46,9 +46,11 @@ export default class extends React.Component {
handleRead = (e, item) => {
e.stopPropagation();
this.state.read.push(item.id);
this.setState({read: this.state.read});
http.patch('/api/notify/', {ids: [item.id]})
if (this.state.read.indexOf(item.id) === -1) {
this.state.read.push(item.id);
this.setState({read: this.state.read});
http.patch('/api/notify/', {ids: [item.id]})
}
};
handleReadAll = () => {