Default Graphs Selections Fix
This commit is contained in:
parent
346376e9ea
commit
0bdbe2b681
1 changed files with 4 additions and 4 deletions
|
@ -33,7 +33,7 @@ export const load: LayoutLoad = async ({ fetch }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof gameSelection === 'undefined') {
|
if (typeof gameSelection === 'undefined') {
|
||||||
gameSelection = chellarisData.games[1].id;
|
gameSelection = Object.values(chellarisData.games)[0].id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Game Groups Selection
|
// Game Groups Selection
|
||||||
|
@ -44,7 +44,7 @@ export const load: LayoutLoad = async ({ fetch }) => {
|
||||||
|
|
||||||
if (typeof gameGroupSelections[gameSelection] === 'undefined') {
|
if (typeof gameGroupSelections[gameSelection] === 'undefined') {
|
||||||
// Default to all available groups
|
// Default to all available groups
|
||||||
gameGroupSelections[gameSelection] = { gameId: gameSelection, selectedGroups: Object.fromEntries(Object.values(chellarisData.games[gameSelection].groups).map((group) => group.id).entries()) };
|
gameGroupSelections[gameSelection] = { gameId: gameSelection, selectedGroups: Object.fromEntries(Object.values(Object.values(chellarisData.games)[gameSelection].groups).map((group) => group.id).entries()) };
|
||||||
|
|
||||||
// Set Local Storage to default Values if not previously defined
|
// Set Local Storage to default Values if not previously defined
|
||||||
localStorage.setItem('gameGroupSelection', JSON.stringify(gameGroupSelections));
|
localStorage.setItem('gameGroupSelection', JSON.stringify(gameGroupSelections));
|
||||||
|
@ -66,14 +66,14 @@ export const load: LayoutLoad = async ({ fetch }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof gameSelection === 'undefined') {
|
if (typeof gameSelection === 'undefined') {
|
||||||
gameSelection = chellarisData.games[1].id;
|
gameSelection = Object.values(chellarisData.games)[0].id;
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectedGameStore.set(gameSelection);
|
SelectedGameStore.set(gameSelection);
|
||||||
|
|
||||||
if (typeof gameGroupSelections[gameSelection] === 'undefined') {
|
if (typeof gameGroupSelections[gameSelection] === 'undefined') {
|
||||||
// Default to all available groups
|
// Default to all available groups
|
||||||
gameGroupSelections[gameSelection] = { gameId: gameSelection, selectedGroups: Object.fromEntries(Object.values(chellarisData.games[gameSelection].groups).map((group) => group.id).entries()) };
|
gameGroupSelections[gameSelection] = { gameId: gameSelection, selectedGroups: Object.fromEntries(Object.values(Object.values(chellarisData.games)[gameSelection].groups).map((group) => group.id).entries()) };
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectedGameGroupsStore.set(gameGroupSelections);
|
SelectedGameGroupsStore.set(gameGroupSelections);
|
||||||
|
|
Reference in a new issue