add fake game for browser development

This commit is contained in:
cyber-dream 2022-10-18 20:48:11 +03:00
parent 902dca5cc2
commit 401a397945

View File

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { Game } from 'src/app/interfaces/game.interface'; import { Game } from 'src/app/interfaces/game.interface';
import { GetGames } from 'src/app/services/go'; import { GetGames } from 'src/app/services/go';
@ -18,12 +19,25 @@ export class GamesBarComponent implements OnInit {
} }
getGames() { getGames() {
GetGames().then((value) => { if (GetGames == undefined){
console.log(value); var fakeGame: Game = {
this.games = value; gameId: "Fake Game",
if (this.games.length > 0){ title: "Fake game",
this.activeGame = this.games[0] 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]
}
});
}
} }
} }