mirror of
				https://github.com/louislam/uptime-kuma.git
				synced 2025-10-31 11:29:20 +08:00 
			
		
		
		
	Fix: Add debounce to favicon update (#3442)
This commit is contained in:
		| @@ -57,7 +57,8 @@ export default { | |||||||
|                 message: "", |                 message: "", | ||||||
|                 errorMessage: "", |                 errorMessage: "", | ||||||
|                 currentPassword: "", |                 currentPassword: "", | ||||||
|             } |             }, | ||||||
|  |             faviconUpdateDebounce: null, | ||||||
|         }; |         }; | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
| @@ -760,7 +761,12 @@ export default { | |||||||
|         // Update Badge |         // Update Badge | ||||||
|         "stats.down"(to, from) { |         "stats.down"(to, from) { | ||||||
|             if (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