Fix not "disconnecting" on refresh
This commit is contained in:
parent
392fc5e7f0
commit
284f294c6d
1 changed files with 3 additions and 0 deletions
|
@ -191,6 +191,9 @@ impl Component for MainMenu {
|
|||
window
|
||||
.add_event_listener_with_callback("pagehide", &resolve)
|
||||
.expect("Should be able to set \"pagehide\" callback");
|
||||
window
|
||||
.add_event_listener_with_callback("beforeunload", &resolve)
|
||||
.expect("Should be able to set \"beforeunload\" callback");
|
||||
});
|
||||
let js_fut = JsFuture::from(promise);
|
||||
js_fut.await.ok();
|
||||
|
|
Loading…
Reference in a new issue