wip 3
This commit is contained in:
parent
162adc0f10
commit
7ba175204d
@ -50,7 +50,7 @@ const optionsOpen = ref(false);
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
games.value = await fetchGames();
|
games.value = await fetchGames();
|
||||||
tags.value = [...new Set(games.value.flatMap(game => game.Genres))];
|
tags.value = [...new Set(games.value.flatMap(game => game.Genres.split(",")))];
|
||||||
selectedTag.value = tags.value[0];
|
selectedTag.value = tags.value[0];
|
||||||
selectedGame.value = store.filteredGames[0];
|
selectedGame.value = store.filteredGames[0];
|
||||||
});
|
});
|
||||||
|
|||||||
@ -45,7 +45,7 @@ export async function fetchGames(): Promise<Game[]> {
|
|||||||
|
|
||||||
// TODO games should be loaded from and started from the wails/go code
|
// TODO games should be loaded from and started from the wails/go code
|
||||||
const games = await LoadGames();
|
const games = await LoadGames();
|
||||||
for (const game in games) {
|
for (const game of games) {
|
||||||
console.log(game)
|
console.log(game)
|
||||||
}
|
}
|
||||||
return games;
|
return games;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export const useAppStore = defineStore('app', {
|
|||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
filteredGames(state): Game[] {
|
filteredGames(state): Game[] {
|
||||||
return state.games.filter(game => game.Genres.includes(state.selectedTag ?? ''));
|
return state.games.filter(game => game.Genres.split(",").includes(state.selectedTag ?? ''));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user