Skip to content

Commit

Permalink
if the tileset doesn't exist, default to defaul
Browse files Browse the repository at this point in the history
  • Loading branch information
amandasaurus committed Apr 8, 2024
1 parent ae66e64 commit a93c6d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ document.addEventListener("alpine:init", async () => {
let params = new URLSearchParams((location.hash ?? "#").substr(1));
let len_filter = decodeFilterParams(params.get("len") ?? "");
let selected_tileset_key = params.get("tiles") ?? tilesets.selected_tileset;
if (!(selected_tileset_key in tilesets.tilesets)) {
console.error("The selected tileset "+selected_tileset_key+" doesn't exist, using default of "+tilesets.selected_tileset+" instead.");
selected_tileset_key = tilesets.selected_tileset;
}
Alpine.store("selected_tileset", selected_tileset_key);
Alpine.store("tilesets_loaded", true);

Expand Down

0 comments on commit a93c6d7

Please sign in to comment.