Files
start-os/setup-wizard/src/app/pages/loading/loading.page.ts
Drew Ansbacher 26af4dacf9 sw build errors
2021-09-06 16:08:08 -06:00

28 lines
769 B
TypeScript

import { Component } from '@angular/core'
import { iosTransitionAnimation, NavController } from '@ionic/angular'
import { StateService } from 'src/app/services/state.service'
@Component({
selector: 'app-loading',
templateUrl: 'loading.page.html',
styleUrls: ['loading.page.scss'],
})
export class LoadingPage {
constructor(
public stateService: StateService,
private navCtrl: NavController
) {}
ngOnInit () {
this.stateService.pollDataTransferProgress()
const progSub = this.stateService.dataProgSubject.subscribe(async progress => {
if(progress === 1) {
progSub.unsubscribe()
await this.navCtrl.navigateForward(`/success`, { animationDirection: 'forward', animation: iosTransitionAnimation })
}
})
}
}