Fix not "disconnecting" on refresh

This commit is contained in:
Stephen Seo 2022-04-08 11:55:31 +09:00
parent 392fc5e7f0
commit 284f294c6d

View file

@ -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();