Change datastore to not need to deserialize LocalStorage for every read

This commit is contained in:
2025-07-06 15:29:51 +02:00
parent ab9f192f6f
commit ca35dbf92b
5 changed files with 93 additions and 74 deletions

View File

@@ -1,7 +1,6 @@
import { fetchJourneys } from './api.js';
import { attachLocationsSearch } from './locations-search.js';
import { addJourneyToDraftingBoard } from './drafting-board.js';
import { DataStore } from './datastore.js';
let element_journeys_search = document.querySelector("#journeys-search");
let element_from = document.querySelector("#journey-search-from");
@@ -27,7 +26,7 @@ function createJourneyElement(journey) {
let el = document.createElement("div");
for (let leg of journey.legs) {
DataStore.locations.rememberAllIfNotExist([leg.origin, leg.destination]);
window.dataStore.locations.rememberAllIfNotExist([leg.origin, leg.destination]);
el.appendChild(createJourneyLegElement(leg));
}