wip 3
This commit is contained in:
parent
b07616086c
commit
c350aedcb5
@ -50,7 +50,7 @@ const optionsOpen = ref(false);
|
||||
|
||||
onMounted(async () => {
|
||||
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];
|
||||
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
|
||||
const games = await LoadGames();
|
||||
for (const game in games) {
|
||||
for (const game of games) {
|
||||
console.log(game)
|
||||
}
|
||||
return games;
|
||||
|
||||
@ -14,7 +14,7 @@ export const useAppStore = defineStore('app', {
|
||||
}),
|
||||
getters: {
|
||||
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: {
|
||||
|
||||
@ -105,7 +105,8 @@ func GetConjureGameInfo() []models.Game {
|
||||
|
||||
fmt.Println("Contents of metadata.txt:")
|
||||
metadata, err := io.ReadAll(rc)
|
||||
parseGameInfo(metadata)
|
||||
game := parseGameInfo(metadata)
|
||||
games = append(games, game)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user