diff --git a/src/app/components/games-bar/games-bar.component.ts b/src/app/components/games-bar/games-bar.component.ts index 6a0e11f..c57cb42 100644 --- a/src/app/components/games-bar/games-bar.component.ts +++ b/src/app/components/games-bar/games-bar.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Title } from '@angular/platform-browser'; import { Game } from 'src/app/interfaces/game.interface'; import { GetGames } from 'src/app/services/go'; @@ -18,12 +19,25 @@ export class GamesBarComponent implements OnInit { } getGames() { - GetGames().then((value) => { - console.log(value); - this.games = value; - if (this.games.length > 0){ - this.activeGame = this.games[0] + if (GetGames == undefined){ + var fakeGame: Game = { + gameId: "Fake Game", + title: "Fake game", + description: "asdasdasd", + image: "gmod.png" } - }); + this.games.push(fakeGame) + this.activeGame = this.games[0] + } + else{ + GetGames().then((value) => { + console.log(value); + this.games = value; + if (this.games.length > 0){ + this.activeGame = this.games[0] + } + }); + } + } }