Loading src/app/dao/socketDataService.ts +12 −0 Original line number Diff line number Diff line Loading @@ -74,4 +74,16 @@ export class SocketDataService { }); }); } getCanPressTabooh(sessionName: string): Observable<any> { if (!this.isConnected) { this.connect(sessionName); } this.sessionName = sessionName; return new Observable(observer => { this.socket.on(this.sessionName + ':canPressTabooh', (res: any) => { observer.next(res); }); }); } } src/app/game/game.component.html +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ <br> <button *ngIf="isExplainer" mat-raised-button color="primary" (click)="rightAnswer()">Richtig ✔</button> <button *ngIf="isExplainer" mat-raised-button color="accent" style="margin: 40px" (click)="newCard()">Überspringen »</button> <button mat-raised-button color="warn" (click)="wrongAnswer()">Tabooh ✘</button> <button mat-raised-button color="warn" [disabled]="PressTaboohDisabled" (click)="wrongAnswer()">Tabooh ✘</button> <br> <br> <mat-card class="transparent"> Loading src/app/game/game.component.ts +8 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ export class GameComponent implements OnInit, OnDestroy { private ngUnsubscribe = new Subject(); subNewCard: any; subEndRound: any; subCanPressTabooh: any; PressTaboohDisabled = false; sessionName = ''; isWatchdog = false; isExplainer = false; Loading Loading @@ -109,6 +111,12 @@ export class GameComponent implements OnInit, OnDestroy { this.router.navigate([this.sessionName + '/' + this.team]); } }); this.subCanPressTabooh = this.socketDataService.getCanPressTabooh(this.sessionName) .pipe(takeUntil(this.ngUnsubscribe)) .subscribe(data => { console.log('Status Tabooh can pressed: ', data); this.PressTaboohDisabled = !JSON.parse(data); }); } onTimesUp(): void { Loading Loading
src/app/dao/socketDataService.ts +12 −0 Original line number Diff line number Diff line Loading @@ -74,4 +74,16 @@ export class SocketDataService { }); }); } getCanPressTabooh(sessionName: string): Observable<any> { if (!this.isConnected) { this.connect(sessionName); } this.sessionName = sessionName; return new Observable(observer => { this.socket.on(this.sessionName + ':canPressTabooh', (res: any) => { observer.next(res); }); }); } }
src/app/game/game.component.html +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ <br> <button *ngIf="isExplainer" mat-raised-button color="primary" (click)="rightAnswer()">Richtig ✔</button> <button *ngIf="isExplainer" mat-raised-button color="accent" style="margin: 40px" (click)="newCard()">Überspringen »</button> <button mat-raised-button color="warn" (click)="wrongAnswer()">Tabooh ✘</button> <button mat-raised-button color="warn" [disabled]="PressTaboohDisabled" (click)="wrongAnswer()">Tabooh ✘</button> <br> <br> <mat-card class="transparent"> Loading
src/app/game/game.component.ts +8 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ export class GameComponent implements OnInit, OnDestroy { private ngUnsubscribe = new Subject(); subNewCard: any; subEndRound: any; subCanPressTabooh: any; PressTaboohDisabled = false; sessionName = ''; isWatchdog = false; isExplainer = false; Loading Loading @@ -109,6 +111,12 @@ export class GameComponent implements OnInit, OnDestroy { this.router.navigate([this.sessionName + '/' + this.team]); } }); this.subCanPressTabooh = this.socketDataService.getCanPressTabooh(this.sessionName) .pipe(takeUntil(this.ngUnsubscribe)) .subscribe(data => { console.log('Status Tabooh can pressed: ', data); this.PressTaboohDisabled = !JSON.parse(data); }); } onTimesUp(): void { Loading