Fix: Add debounce to favicon update (#3442)

pull/3318/head^2
Nelson Chan 1 year ago committed by GitHub
parent 587d9e4781
commit 09c6798a30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -57,7 +57,8 @@ export default {
message: "",
errorMessage: "",
currentPassword: "",
}
},
faviconUpdateDebounce: null,
};
},
@ -760,7 +761,12 @@ export default {
// Update Badge
"stats.down"(to, from) {
if (to !== from) {
favicon.badge(to);
if (this.faviconUpdateDebounce != null) {
clearTimeout(this.faviconUpdateDebounce);
}
this.faviconUpdateDebounce = setTimeout(() => {
favicon.badge(to);
}, 1000);
}
},

Loading…
Cancel
Save