refine startup alerts, reversions in mocks

This commit is contained in:
Matt Hill
2021-07-16 17:58:53 -06:00
committed by Aiden McClelland
parent 8cfd98bbd0
commit e8bf254b91
18 changed files with 473 additions and 314 deletions

View File

@@ -1,7 +1,6 @@
import { Component } from '@angular/core'
import { NavController } from '@ionic/angular'
import { LoadingController } from '@ionic/angular'
import { AuthService } from 'src/app/services/auth.service'
import { LoaderService } from 'src/app/services/loader.service'
@Component({
selector: 'login',
@@ -12,15 +11,18 @@ export class LoginPage {
password = ''
unmasked = false
error = ''
loader: HTMLIonLoadingElement
constructor (
private readonly authService: AuthService,
private readonly loader: LoaderService,
private readonly navCtrl: NavController,
private readonly loadingCtrl: LoadingController,
) { }
ionViewDidEnter () {
this.error = ''
ngOnDestroy () {
if (this.loader) {
this.loader.dismiss()
this.loader = undefined
}
}
toggleMask () {
@@ -28,14 +30,21 @@ export class LoginPage {
}
async submit () {
this.error = ''
this.loader = await this.loadingCtrl.create({
message: 'Authenticating',
spinner: 'lines',
})
await this.loader.present()
try {
await this.loader.displayDuringP(
this.authService.login(this.password),
)
await this.authService.login(this.password)
this.loader.message = 'Loading Embassy Data'
this.password = ''
await this.navCtrl.navigateForward(['/'])
} catch (e) {
this.error = e.message
this.loader.dismiss()
}
}
}

View File

@@ -1,10 +1,10 @@
<ion-content *ngIf="patch.data['serverInfo'].status as status">
<ion-content *ngIf="patch.data['server-info'].status as status">
<ion-grid style="height: 100%;">
<ion-row class="ion-align-items-center ion-text-center" style="height: 100%;">
<ion-col>
<ion-spinner name="lines" color="warning"></ion-spinner>
<p *ngIf="status === ServerStatus.Updating">Updating Embassy</p>
<p *ngIf="status === ServerStatus.Updating">Embassy is updating</p>
<p *ngIf="status === ServerStatus.BackingUp">Embassy is backing up</p>
</ion-col>
</ion-row>