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

Commit

Permalink
fix(settings): only show elements once initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Sep 18, 2020
1 parent 4ec7cb1 commit 8550426
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/app/settings/settings.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ <h3>Disable Sleep</h3>
</ion-list-header>
<ion-item>
<ion-label class="ion-text-wrap">Disable sleep while games are active?</ion-label>
<ion-toggle (ionChange)="setDisableSleep()" [(ngModel)]="current.disableSleep" slot="end"></ion-toggle>
<ion-toggle *ngIf="current" (ionChange)="setDisableSleep()" [(ngModel)]="current.disableSleep" slot="end"></ion-toggle>
</ion-item>
</span>
<ion-list-header lines="full">
<h3>Reduce Motion</h3>
</ion-list-header>
<ion-item>
<ion-label class="ion-text-wrap">Reduce motion in effects?</ion-label>
<ion-toggle (ionChange)="setReduceMotion()" [(ngModel)]="current.reduceMotion" slot="end"></ion-toggle>
<ion-toggle *ngIf="current" (ionChange)="setReduceMotion()" [(ngModel)]="current.reduceMotion" slot="end"></ion-toggle>
</ion-item>
<ion-list-header lines="full">
<h3>Teams</h3>
Expand All @@ -50,7 +50,7 @@ <h4>Choose Your Team:</h4>
</ion-label>
</ion-item>
<ion-item>
<ion-select class="ion-text-wrap" (ionChange)="setFavoriteTeam($event.detail)" interface="action-sheet" [interfaceOptions]="teamOptions" okText="Choose" cancelText="Cancel" [value]="current.favoriteTeam" [(ngModel)]="current.favoriteTeam">
<ion-select *ngIf="current && teams" class="ion-text-wrap" (ionChange)="setFavoriteTeam($event.detail)" interface="action-sheet" [interfaceOptions]="teamOptions" okText="Choose" cancelText="Cancel" [value]="current.favoriteTeam" [(ngModel)]="current.favoriteTeam">
<ion-select-option *ngFor="let team of teams; trackBy: id" [value]="team.id">{{team.fullName}}</ion-select-option>
</ion-select>
</ion-item>
Expand Down
4 changes: 2 additions & 2 deletions src/app/settings/settings.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import Util from 'src/lib/util';
styleUrls: ['./settings.page.scss'],
})
export class SettingsPage implements OnInit {
public current = {} as Settings;
public current: Settings;
public betaEnabled = false;
public devicePlatform = 'web';

public teamOptions: any = {
header: 'Choose Your Team',
};

public teams = [] as Team[];
public teams: Team[];

id = Util.trackById;

Expand Down

0 comments on commit 8550426

Please sign in to comment.