mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-16 17:31:24 +01:00
debug: add logging to troubleshoot default map issue
This commit is contained in:
parent
45f56b8c5d
commit
390e70f63a
2 changed files with 3 additions and 0 deletions
2
main.js
2
main.js
|
|
@ -293,9 +293,11 @@ async function checkLoadParameters() {
|
|||
|
||||
// restore onloadBehavior from localStorage if saved
|
||||
const storedBehavior = localStorage.getItem("onloadBehavior");
|
||||
WARN && console.warn("Stored onloadBehavior:", storedBehavior);
|
||||
if (storedBehavior) {
|
||||
byId("onloadBehavior").value = storedBehavior;
|
||||
}
|
||||
WARN && console.warn("Current onloadBehavior value:", byId("onloadBehavior").value);
|
||||
|
||||
// check if there is a default map saved to indexedDB
|
||||
if (byId("onloadBehavior").value === "default") {
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ async function saveAsDefaultMap() {
|
|||
await ldb.set("defaultMap", blob);
|
||||
localStorage.setItem("onloadBehavior", "default");
|
||||
byId("onloadBehavior").value = "default";
|
||||
WARN && console.warn("Default map saved. onloadBehavior set to:", localStorage.getItem("onloadBehavior"));
|
||||
tip("Map is set as default and will open on load", true, "success", 5000);
|
||||
} catch (error) {
|
||||
ERROR && console.error(error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue