mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-24 06:49:41 -05:00
Fix: Add debounce to favicon update (#3442)
This commit is contained in:
parent
587d9e4781
commit
09c6798a30
@ -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 New Issue
Block a user