Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
feat: mute/unmute from game log
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Sep 19, 2020
1 parent 71ae792 commit 388c551
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/diamond/diamond.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
</div>
</ion-col>
</ion-row>
<ion-row>
<ion-row *ngIf="!hideLog">
<ion-col size="12">
<div class="scorebox-border">
<div class="rotate-display lastUpdate">{{game.lastUpdate}}</div>
Expand Down
1 change: 1 addition & 0 deletions src/app/diamond/diamond.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class DiamondComponent implements DoCheck, OnInit {
@Input() public game: Game;
@Input() public allowOpenGame = true;
@Input() public prefix = 'diamond';
@Input() public hideLog = false;
@Output() public refresh: EventEmitter<any> = new EventEmitter();

public font = {
Expand Down
10 changes: 5 additions & 5 deletions src/app/game-detail/game-detail.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
</ion-buttons>
<ion-title *ngIf="game">{{game.awayTeamNickname}} at {{game.homeTeamNickname}}</ion-title>
<ion-buttons slot="secondary">
<ion-button (click)="muted = !muted">
<ion-icon *ngIf="!muted" name="volume-high-outline"></ion-icon>
<ion-icon *ngIf="muted" name="volume-mute-outline"></ion-icon>
<ion-button (click)="settings.toggleSpeech()">
<ion-icon *ngIf="settings.speech()" name="volume-high-outline"></ion-icon>
<ion-icon *ngIf="!settings.speech()" name="volume-mute-outline"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<app-diamond *ngIf="game" prefix="game-detail" [allowOpenGame]="false" [game]="game"></app-diamond>
<app-diamond *ngIf="game" prefix="game-detail" [allowOpenGame]="false" [hideLog]="true" [game]="game"></app-diamond>
<ion-content *ngIf="game" class="ion-no-margin ion-no-border">
<span class="log-entry" *ngFor="let update of updateLog.slice(1)">
<span class="log-entry" *ngFor="let update of updateLog">
<ion-item class="ion-no-padding ion-no-margin" lines="none">
<ion-text class="time ion-align-self-start" slot="start" lines="none">
{{update.time}}
Expand Down
2 changes: 2 additions & 0 deletions src/app/game-detail/game-detail.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Subscription } from 'rxjs';
import { APIStream } from 'src/lib/api/stream';
import { Game } from 'src/lib/model/game';
import { StreamData } from 'src/lib/model/streamData';
import { SettingsService } from 'src/lib/settings.service';
import { VoiceService } from 'src/lib/voice.service';

@Component({
Expand All @@ -22,6 +23,7 @@ export class GameDetailPage implements OnInit {

constructor(
private modalController: ModalController,
public settings: SettingsService,
public stream: APIStream,
public voiceService: VoiceService,
) { }
Expand Down
3 changes: 3 additions & 0 deletions src/lib/settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ export class SettingsService {
async setSpeech(speech: boolean) {
return this.setBoolean('speech', speech);
}
async toggleSpeech() {
return await this.setSpeech(!this.speech());
}

volume(): number {
return this.getNumber('volume');
Expand Down

0 comments on commit 388c551

Please sign in to comment.