Skip to content

Commit

Permalink
Add filter remove delay change
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Sep 2, 2022
1 parent 4b1a3db commit f6b02b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libs/UnreadIndicatorUpdater/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const reports = {};
* and Mac OS or iOS dock icon with an unread indicator.
*/
const throttledUpdatePageTitleAndUnreadCount = _.throttle(() => {
const totalCount = _.reduce(reports, (total, report) => total + (ReportUtils.isUnread(report) ? 1 : 0), 0);
const totalCount = _.filter(reports, ReportUtils.isUnread).length;
updateUnread(totalCount);
}, 300, {leading: false});
}, 1000, {leading: false});

let connectionID;

Expand Down
3 changes: 2 additions & 1 deletion src/pages/home/report/ReportActionsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ class ReportActionsView extends React.Component {
this.setState({newMarkerSequenceNumber: currentLastSequenceNumber});
}
} else if (this.state.newMarkerSequenceNumber === 0) {
// The report is not in view so we will update the newMarkerSequenceNumber
// The report is not in view and we received a comment from another user while the new marker is not set
// so we wil set the new marker now.
this.setState({newMarkerSequenceNumber: currentLastSequenceNumber});
}
}
Expand Down

0 comments on commit f6b02b4

Please sign in to comment.