Default Fame Selection Fix

This commit is contained in:
Neshura 2023-09-12 19:19:45 +02:00
parent 98d7bc5567
commit 0fdc4c07f6
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -4,6 +4,7 @@
import Header from './Header.svelte';
import './styles.css';
import AdminSelectedGameStore from '$lib/stores/admin-page/GameStore';
import type { ChellarisGameInfo } from '$lib/types/chellaris';
$: {
fetch(apiBaseUrl + '/v3/ethics').then((res) => {
@ -19,9 +20,9 @@
});
fetch(apiBaseUrl + '/v3/games').then((res) => {
res.json().then((data) => {
res.json().then((data: { [key: number]: ChellarisGameInfo }) => {
if ($AdminSelectedGameStore == 1) {
$AdminSelectedGameStore = data[0].id;
$AdminSelectedGameStore = Object.values(data)[0].id;
}
});