diff --git a/src/lib/stores/ChellarisData.ts b/src/lib/stores/ChellarisData.ts index 0729c9b..5b8c659 100644 --- a/src/lib/stores/ChellarisData.ts +++ b/src/lib/stores/ChellarisData.ts @@ -1,6 +1,10 @@ import { writable, type Writable } from "svelte/store"; import type { ChellarisInfo } from '../types/chellaris'; -const ChellarisDataStore: Writable = writable(); +const ChellarisDataStore: Writable = writable({ + games: new Map(), + ethics: [], + portraits: [] +}); export default ChellarisDataStore; \ No newline at end of file diff --git a/src/routes/graphs/+layout.ts b/src/routes/graphs/+layout.ts index aa99842..91c195d 100644 --- a/src/routes/graphs/+layout.ts +++ b/src/routes/graphs/+layout.ts @@ -54,11 +54,15 @@ export const load: LayoutLoad = async () => { } }); - console.log(chellarisData); //DEBUG + const ethics: {id: number, name: string, fanatic: boolean}[] = await (await fetch(apiBaseUrl + '/ethics')).json(); + + ethics.forEach(ethic => { + console.log(ethic.name); + }); + ChellarisDataStore.set(chellarisData); // Local Storage Code - if (typeof localStorage !== 'undefined') { // Tab Selection store = localStorage.getItem('graphsTab');