Skip to content

Commit

Permalink
Show Login and SHAPES mode only for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
PavlosIsaris committed Jul 4, 2022
1 parent dda5bc4 commit 0135195
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export class MyApp {
console.log("DIANOIA_APP_FINISHED_LANG_" + this.translate.currentLang);
}

platformAndroid() {
return this.platform.is('android');
}

async setTranslationSettings() {
let langCodeToTry = Helpers.getURLParam("lang");
if (!langCodeToTry) {
Expand Down Expand Up @@ -189,6 +193,9 @@ export class MyApp {
if (!authMode)
return resolve(false);

if (!this.platformAndroid())
return resolve(false);

const tokenParam = Helpers.getURLParam("auth_token");
if (tokenParam) {
await this.appStorage.set('auth_token', tokenParam);
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
{{p.title}}
</button>
<button ion-item (click)="login()">
<button ion-item (click)="login()" *ngIf="platformAndroid()">
{{ 'login_btn' | translate }}
<ion-badge item-end>SHAPES</ion-badge>
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<h2>{{ 'settings' | translate }}</h2>
</ion-col>
</ion-row>
<ion-row style="margin-bottom: 5rem">
<ion-row style="margin-bottom: 5rem" *ngIf="platformAndroid()">
<ion-col col-lg-4 col-md-6 col-sm-12>
<ion-item>
<ion-label>SHAPES Mode</ion-label>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ export class SettingsPage {
}
}

platformAndroid() {
return this.platform.is('android');
}

}

0 comments on commit 0135195

Please sign in to comment.