Improve datastore about cached trip details
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
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");
|
||||
@@ -26,6 +27,7 @@ function createJourneyElement(journey) {
|
||||
let el = document.createElement("div");
|
||||
|
||||
for (let leg of journey.legs) {
|
||||
DataStore.locations.rememberAllIfNotExist([leg.origin, leg.destination]);
|
||||
el.appendChild(createJourneyLegElement(leg));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user