front-end: Minor refactorings fixes
This commit is contained in:
parent
b158e7347e
commit
f799bae530
1 changed files with 2 additions and 1 deletions
|
@ -605,9 +605,9 @@ impl Wrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cleanup_disconnect_callbacks(&mut self) {
|
fn cleanup_disconnect_callbacks(&mut self) {
|
||||||
let window = web_sys::window().expect("Should be able to get window");
|
|
||||||
// if previously set disconnect callback is set, unset it
|
// if previously set disconnect callback is set, unset it
|
||||||
if let Some(callback) = self.cleanup_id_callback.take() {
|
if let Some(callback) = self.cleanup_id_callback.take() {
|
||||||
|
let window = web_sys::window().expect("Should be able to get window");
|
||||||
let mut options = EventListenerOptions::new();
|
let mut options = EventListenerOptions::new();
|
||||||
options.capture(true);
|
options.capture(true);
|
||||||
if window
|
if window
|
||||||
|
@ -1288,6 +1288,7 @@ impl Component for Wrapper {
|
||||||
if !self.do_backend_tick || !is_networked_multiplayer {
|
if !self.do_backend_tick || !is_networked_multiplayer {
|
||||||
// disconnect id if backend tick is to be stopped
|
// disconnect id if backend tick is to be stopped
|
||||||
self.send_disconnect();
|
self.send_disconnect();
|
||||||
|
self.cleanup_disconnect_callbacks();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue