mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 20:43:41 +00:00
* refactor setup backend * rework setup wizard according to new scheme * fix bug with partitions in SW and warning message in IW * treat localhost as LAN for launching services * misc backend fixes Co-authored-by: Matt Hill <matthewonthemoon@gmail.com>
33 lines
850 B
TypeScript
33 lines
850 B
TypeScript
import { Component } from '@angular/core'
|
|
import { NavController } from '@ionic/angular'
|
|
import { ApiService } from './services/api/api.service'
|
|
import { ErrorToastService } from '@start9labs/shared'
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: 'app.component.html',
|
|
styleUrls: ['app.component.scss'],
|
|
})
|
|
export class AppComponent {
|
|
constructor(
|
|
private readonly apiService: ApiService,
|
|
private readonly errorToastService: ErrorToastService,
|
|
private readonly navCtrl: NavController,
|
|
) {}
|
|
|
|
async ngOnInit() {
|
|
try {
|
|
const inProgress = await this.apiService.getStatus()
|
|
|
|
let route = '/home'
|
|
if (inProgress) {
|
|
route = inProgress.complete ? '/success' : '/loading'
|
|
}
|
|
|
|
await this.navCtrl.navigateForward(route)
|
|
} catch (e: any) {
|
|
this.errorToastService.present(e)
|
|
}
|
|
}
|
|
}
|