mirror of https://github.com/JustKato/FreePad.git
				
				
				
			* Cleanup
This commit is contained in:
		
							parent
							
								
									177ab62720
								
							
						
					
					
						commit
						5518103575
					
				| 
						 | 
					@ -51,9 +51,14 @@ class PadSocket {
 | 
				
			||||||
            updateStatus(`Established`, `text-success`);
 | 
					            updateStatus(`Established`, `text-success`);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        function onFail() {
 | 
				
			||||||
 | 
					            updateStatus(`Connection Failed`, `text-dangerous`);
 | 
				
			||||||
 | 
					            setTimeout( connectSocket , 1000);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Try and reconnect on failure
 | 
					        // Try and reconnect on failure
 | 
				
			||||||
        ws.onclose = connectSocket;
 | 
					        ws.onclose = onFail;
 | 
				
			||||||
        ws.onerror = connectSocket;
 | 
					        ws.onerror = onFail;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        // Assign the websocket
 | 
					        // Assign the websocket
 | 
				
			||||||
        this.ws = ws;
 | 
					        this.ws = ws;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue