mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
fix: persist onloadBehavior setting for default map feature
The default map feature was not working on page refresh because the onloadBehavior dropdown value was not being persisted or restored. Changes: - main.js: Restore onloadBehavior from localStorage on page load - save.js: saveAsDefaultMap() now saves "default" to localStorage - save.js: clearDefaultMap() now removes the localStorage setting - index.html: Update version hashes to 1.108.13 Now when users click "Set as default", the setting persists across page refreshes and their default map loads automatically.
This commit is contained in:
parent
57b7980dbc
commit
45f56b8c5d
3 changed files with 12 additions and 2 deletions
6
main.js
6
main.js
|
|
@ -291,6 +291,12 @@ async function checkLoadParameters() {
|
|||
return;
|
||||
}
|
||||
|
||||
// restore onloadBehavior from localStorage if saved
|
||||
const storedBehavior = localStorage.getItem("onloadBehavior");
|
||||
if (storedBehavior) {
|
||||
byId("onloadBehavior").value = storedBehavior;
|
||||
}
|
||||
|
||||
// check if there is a default map saved to indexedDB
|
||||
if (byId("onloadBehavior").value === "default") {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue