From 601a3bf1e085e3a28d0e91e3bd2f2d0de5b4ab62 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 22 Nov 2019 05:43:40 -0500 Subject: don't manually disconnect on disconnect events we only get the disconnect events after the disconnect happens, and in this particular case it's happening because we dropped the old connection to replace it with a new connection, and so manually clearing the current connection on a disconnect event will usually end up clearing the new connection --- teleterm-web/src/lib.rs | 1 - teleterm-web/src/model.rs | 4 ---- 2 files changed, 5 deletions(-) (limited to 'teleterm-web') diff --git a/teleterm-web/src/lib.rs b/teleterm-web/src/lib.rs index 9ec713e..453d086 100644 --- a/teleterm-web/src/lib.rs +++ b/teleterm-web/src/lib.rs @@ -55,7 +55,6 @@ fn update( } ws::WebSocketEvent::Disconnected(_) => { log("disconnected"); - model.watch_disconnect(); } ws::WebSocketEvent::Message(msg) => { log(&format!("message from id {}: {:?}", id, msg)); diff --git a/teleterm-web/src/model.rs b/teleterm-web/src/model.rs index 77b3ead..263dd7c 100644 --- a/teleterm-web/src/model.rs +++ b/teleterm-web/src/model.rs @@ -54,8 +54,4 @@ impl Model { pub fn update_sessions(&mut self, sessions: Vec) { self.sessions = sessions; } - - pub fn watch_disconnect(&mut self) { - self.watch_conn = None; - } } -- cgit v1.2.3-54-g00ecf