Skip to content

Commit

Permalink
update lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pradeepmdk committed Oct 12, 2023
1 parent 88893c5 commit 04c4827
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libs/UnreadIndicatorUpdater/updateUnread/index.website.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
*/
import CONFIG from '../../../CONFIG';

let _totalCount = 0;
let unReadTotalCount = 0;
/**
* Set the page title on web
*
* @param {Number} totalCount
*/
function updateUnread(totalCount) {
const hasUnread = totalCount !== 0;
_totalCount = totalCount;
unReadTotalCount = totalCount;
// This setTimeout is required because due to how react rendering messes with the DOM, the document title can't be modified synchronously, and we must wait until all JS is done
// running before setting the title.
setTimeout(() => {
Expand All @@ -23,8 +23,8 @@ function updateUnread(totalCount) {
}, 0);
}

window.addEventListener('popstate', (event) => {
updateUnread(_totalCount)
})
window.addEventListener('popstate', () => {
updateUnread(unReadTotalCount);
});

export default updateUnread;

0 comments on commit 04c4827

Please sign in to comment.