mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	Use onstorage event - don't poll. Increase screenshot frequency to one second.
This commit is contained in:
		| @@ -132,6 +132,9 @@ GuacamoleHistory = new (function() { | |||||||
|      */ |      */ | ||||||
|     this.onchange = null; |     this.onchange = null; | ||||||
|  |  | ||||||
|  |     // Reload when modified | ||||||
|  |     window.addEventListener("storage", guac_history.reload); | ||||||
|  |  | ||||||
|     // Initial load |     // Initial load | ||||||
|     guac_history.reload(); |     guac_history.reload(); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -418,9 +418,8 @@ GuacamoleUI.attach = function(guac) { | |||||||
|                 if (GuacamoleUI.sessionState.getProperty("clipboard")) |                 if (GuacamoleUI.sessionState.getProperty("clipboard")) | ||||||
|                     guac.setClipboard(GuacamoleUI.sessionState.getProperty("clipboard")); |                     guac.setClipboard(GuacamoleUI.sessionState.getProperty("clipboard")); | ||||||
|  |  | ||||||
|                 // Regularly update screenshot if storage available |                 // Regularly update screenshot | ||||||
|                 if (localStorage) |                 window.setInterval(updateThumbnail, 1000); | ||||||
|                     window.setInterval(updateThumbnail, 5000); |  | ||||||
|  |  | ||||||
|                 break; |                 break; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -323,12 +323,6 @@ GuacamoleRootUI.reset = function() { | |||||||
|     GuacamoleRootUI.views.login.style.display = "none"; |     GuacamoleRootUI.views.login.style.display = "none"; | ||||||
|     GuacamoleRootUI.views.connections.style.display = ""; |     GuacamoleRootUI.views.connections.style.display = ""; | ||||||
|  |  | ||||||
|     // Reload history every 5 seconds |  | ||||||
|     window.setInterval(GuacamoleHistory.reload, 5000); |  | ||||||
|  |  | ||||||
|     // Reload history when focus gained |  | ||||||
|     window.onfocus = GuacamoleHistory.reload; |  | ||||||
|  |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
| GuacamoleHistory.onchange = function(id, old_entry, new_entry) { | GuacamoleHistory.onchange = function(id, old_entry, new_entry) { | ||||||
|   | |||||||
| @@ -98,11 +98,8 @@ function GuacamoleSessionState() { | |||||||
|      */ |      */ | ||||||
|     this.onchange = null; |     this.onchange = null; | ||||||
|  |  | ||||||
|     // Reload properties every second |     // Reload when modified | ||||||
|     window.setInterval(guac_state.reload, 1000); |     window.addEventListener("storage", guac_state.reload); | ||||||
|  |  | ||||||
|     // Reload properties when focus is gained |  | ||||||
|     window.addEventListener("focus", guac_state.reload); |  | ||||||
|  |  | ||||||
|     // Initial load |     // Initial load | ||||||
|     guac_state.reload(); |     guac_state.reload(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user