mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 14:29:45 +00:00
* rename frontend to web and update contributing guide * rename this time * fix build * restructure rust code * update documentation * update descriptions * Update CONTRIBUTING.md Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com> --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com>
54 lines
1.2 KiB
TypeScript
54 lines
1.2 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'
|
|
import { StateService } from 'src/app/services/state.service'
|
|
|
|
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,
|
|
private readonly stateService: StateService,
|
|
) {}
|
|
|
|
async ionViewDidEnter() {
|
|
this.stateService.setupType = 'fresh'
|
|
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)
|
|
}
|
|
}
|