octokatherine/word-master

navigating away results in losing the puzzle

trumad opened this issue · 3 comments

I'm one of those weird users who still has backspace configured to go back. So when I played this for my first time, and attempted to make a correction with backspace, my browser navigated away from the page. I'll never know what that word was 😢

When this happens in Wordle, it's not a big deal, because it uses a "gameState" object in localStorage to persist the state (and the solution, funny enough). So when the user navigates back to the page it's as if nothing happened. Would it be possible to implement something similar?

Yep I like the idea of saving the game state in local storage!

HI @trumad, As a suggestion, backspace seems to work fine on Google Chrome but not Firefox. So, it seems like a browser-specific item.

Yeah, and specifically only if the user has changed "browser.backspace_action" to 0 in about:config. That's my personal preference, and it's not the job of this dev to account for that. But when it does happen, it would be great if the app used localStorage so I don't lose progress. And I figured that other users who accidentally close the tab or refresh would appreciate this also.