mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
Fix: Add debounce to favicon update (#3442)
This commit is contained in:
parent
587d9e4781
commit
09c6798a30
1 changed files with 8 additions and 2 deletions
|
@ -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…
Reference in a new issue