henck / trizbort

This is a browser implementation of the Trizbort adventure game mapping and code generation software.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Save current map state in IndexedDB or local storage

dfabulich opened this issue · comments

If you refresh or navigate away, the current map is lost. (There's a beforeunload handler to protect you, which helps somewhat.)

It would be better if the current map state were stored in IndexedDB or local storage. Then you could refresh the page or navigate away and come back later, and the map would still be there waiting for you.

I've removed the beforeunload event. Instead, on unload, the current map gets saved to localStorage. When Trizbort.io opens, it attempts to load a map from localStorage, if there is one. This is overruled when Trizbort.io is loaded a map from a URL, though (which would effectively overwrite your localStorage map unless you kill the browser).