Skip to content

Conversation

nandastone
Copy link
Contributor

@nandastone nandastone commented Dec 17, 2021

This MR adds checks to window.beforeunload to prevent accidentally navigating away from an in-progress game.

This has bitten me a few times while testing, when I've accidentally hit one of the back/forward side buttons on my mouse. Very annoying!

Refreshing page:

CleanShot 2021-12-17 at 21 29 36

Closing tab:

CleanShot 2021-12-17 at 21 57 45

Allow webpack-dev-server live reload to bypass the check to preserve dev feedback loop:

CleanShot 2021-12-17 at 21 53 06

@gitpod-io
Copy link

gitpod-io bot commented Dec 17, 2021

@DreadKnight
Copy link
Member

DreadKnight commented Dec 18, 2021

Neat stuff, always dig small touches like this that improve quality of life somehow, as I'm a big fan or https://littlebigdetails.com :-)

@DreadKnight DreadKnight merged commit 568d343 into FreezingMoon:master Dec 18, 2021
@nandastone nandastone deleted the prevent-navigation-on-game branch December 18, 2021 05:43
CyberBishop pushed a commit to CyberBishop/AncientBeast that referenced this pull request Apr 20, 2023
…on-on-game

Prevent accidentally navigating away from an in progress game
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants