Web Dev Solutions

Catalin Mititiuc

From 85f5abb4e260a37bd4be8d2f566b51b8b3f4adad Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Thu, 30 May 2024 18:06:46 -0700 Subject: Fix storing scenario in local storage --- src/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index d677b01..992366a 100644 --- a/src/index.js +++ b/src/index.js @@ -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'), -- cgit v1.2.3