Fix storing scenario in local storage

This commit is contained in:
2025-06-16 22:41:31 -07:00
parent 2458e1a308
commit f53358216c
4 changed files with 21 additions and 17 deletions

View File

@@ -3,7 +3,7 @@ import * as gameboard from './modules/gameboard.js';
import * as recordSheet from './modules/record_sheet.js';
import * as mapSelectDialog from './modules/map_select_dialog.js';
import { Observable } from './modules/observable.js';
import sideShow from './assets/images/scenario-side_show.svg';
import { scenarios } from './modules/scenarios.js';
globalThis.svgns = 'http://www.w3.org/2000/svg';
@@ -13,8 +13,7 @@ const mapPlaceholder = document.querySelector('.map-placeholder'),
contentVisToggleEl = document.querySelector('#content input[type="checkbox"].visible'),
// fileName = localStorage.getItem('map') || (env === 'test' ? 'test_map' : 'map1'),
fileName = localStorage.getItem('map') || 'scenario-side_show',
// map = `assets/images/${fileName}.svg`,
map = sideShow,
map = scenarios[fileName]?.hashed || `assets/images/${fileName}.svg`,
fileInputEl = document.querySelector('input[type="file"]'),
dice = document.querySelectorAll('.die'),