save storage function added

This commit is contained in:
Ryan Bakkes 2022-01-03 02:34:35 +01:00
parent 0610c8b76f
commit 938dc72044
3 changed files with 5 additions and 3 deletions

View File

@ -31,6 +31,10 @@ export class GameService {
await this.storage.remove(`${game.toUpperCase()}GAME_TOKEN`); await this.storage.remove(`${game.toUpperCase()}GAME_TOKEN`);
} }
public async saveGameStorage(game: string, status: string, type: string, value: any){
await this.storage.set(`${game.toUpperCase()}GAME_TOKEN`, { status: status, type: value});
}
// finish when backend is completed // finish when backend is completed
public async createGameStorage(game: string){ public async createGameStorage(game: string){
// return await this.http.post(`${config.endpoint}/...`, data).pipe( // return await this.http.post(`${config.endpoint}/...`, data).pipe(

View File

@ -39,7 +39,6 @@
[ngStyle]="{ zIndex: this.game.cardset.length - i, transform: 'scale(' + (20 - i) / 20 + ') translateY(-' + 20 * i + 'px)' }"> [ngStyle]="{ zIndex: this.game.cardset.length - i, transform: 'scale(' + (20 - i) / 20 + ') translateY(-' + 20 * i + 'px)' }">
<h3>{{ card.title }}</h3> <h3>{{ card.title }}</h3>
<p>{{ card.description }}</p>
</div> </div>

View File

@ -178,10 +178,9 @@ export class ValuesPage {
this.game.cardset.shift(); this.game.cardset.shift();
} }
console.log(this.game.cardset.length);
// go to rearrange page // go to rearrange page
if(this.game.cardset.length <= 5){ if(this.game.cardset.length <= 5){
console.log("may remove"); await this.game.saveGameStorage("Values", "Alligning", "cards", this.game.cardset);
await this.alertService.presentAlert("Cards selected","INSTRUCTIONS WILL COME HERE"); await this.alertService.presentAlert("Cards selected","INSTRUCTIONS WILL COME HERE");
console.log("SYNC TO NEXT PAGE"); console.log("SYNC TO NEXT PAGE");
} }