Files
start-os/frontend/projects/setup-wizard/src/app/pages/home/home.page.ts
Matt Hill 45a6a930c9 Add guid to partition type (#1932)
* add guid to partitions and implement pipe in shared to return guid for any disk

* fix bug and clean up
2022-11-29 09:43:54 -07:00

51 lines
1.0 KiB
TypeScript

import { Component } from '@angular/core'
import { IonicSlides } from '@ionic/angular'
import { ApiService } from 'src/app/services/api/api.service'
import SwiperCore, { Swiper } from 'swiper'
import { ErrorToastService } from '@start9labs/shared'
SwiperCore.use([IonicSlides])
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
swiper?: Swiper
error = false
loading = true
constructor(
private readonly api: ApiService,
private readonly errToastService: ErrorToastService,
) {}
async ionViewDidEnter() {
if (this.swiper) {
this.swiper.allowTouchMove = false
}
try {
await this.api.getPubKey()
} catch (e: any) {
this.error = true
this.errToastService.present(e)
} finally {
this.loading = false
}
}
setSwiperInstance(swiper: any) {
this.swiper = swiper
}
next() {
this.swiper?.slideNext(500)
}
previous() {
this.swiper?.slidePrev(500)
}
}