debug: add logging to troubleshoot default map issue

This commit is contained in:
Claude 2025-11-14 03:43:51 +00:00
parent 45f56b8c5d
commit 390e70f63a
No known key found for this signature in database
2 changed files with 3 additions and 0 deletions

View file

@ -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") {

View file

@ -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);