mirror of
				https://github.com/louislam/uptime-kuma.git
				synced 2025-10-31 03:19:20 +08:00 
			
		
		
		
	Fix: Add debounce to favicon update (#3442)
This commit is contained in:
		| @@ -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); | ||||
|             } | ||||
|         }, | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user