]> git.seodisparate.com - EN605.607.81.SP22_ASDM_Project/commit
front-end: fix repeated disconnects on close
authorStephen Seo <seo.disparate@gmail.com>
Fri, 29 Apr 2022 02:08:54 +0000 (11:08 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Fri, 29 Apr 2022 02:08:54 +0000 (11:08 +0900)
commite77d25996d239101bb97d12f51c10f2c636c8160
treeed3dbb0188dd90c58905608ba8869df7ea322f0c
parente0ed5fc5d86b227644f20e76fdcd0288c41d4f20
front-end: fix repeated disconnects on close

When the front-end connects to the back-end, it creates a callback that
sends a disconnect message with the received ID on "pagehide" and
"beforeunload" events. The previous implementation did not "undo" these
callbacks when the game was reset and a new ID was received. This fix
prevents the front-end from resending disconnect messages with
previously received IDs on browser window/tab close.
front_end/Cargo.toml
front_end/src/yew_components.rs