mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
wizard edits
This commit is contained in:
committed by
Aiden McClelland
parent
8cf945b738
commit
3721d419a3
@@ -1,6 +1,6 @@
|
||||
<ion-content color="light">
|
||||
<ion-grid style="padding-top: 32px; height: 100%; max-width: 540px;">
|
||||
<ion-row class="ion-align-items-center" style="height: 100%;">
|
||||
<ion-row style="height: 100%;">
|
||||
<ion-col class="ion-text-center">
|
||||
|
||||
<div style="padding-bottom: 32px;">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { AlertController, ModalController, NavController } from '@ionic/angular'
|
||||
import { AlertController, LoadingController, ModalController, NavController } from '@ionic/angular'
|
||||
import { ApiService, EmbassyDrive } from 'src/app/services/api/api.service'
|
||||
import { StateService } from 'src/app/services/state.service'
|
||||
import { PasswordPage } from '../password/password.page'
|
||||
@@ -20,6 +20,7 @@ export class EmbassyPage {
|
||||
private modalController: ModalController,
|
||||
private stateService: StateService,
|
||||
private readonly alertCtrl: AlertController,
|
||||
private loadingCtrl: LoadingController
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -35,26 +36,28 @@ export class EmbassyPage {
|
||||
}
|
||||
})
|
||||
modal.onDidDismiss().then(async ret => {
|
||||
if (!ret.data && !ret.data.success) return
|
||||
if (!ret.data || !ret.data.password) return
|
||||
|
||||
if(!!this.stateService.recoveryDrive) {
|
||||
await this.navCtrl.navigateForward(`/loading`, { animationDirection: 'forward' })
|
||||
} else {
|
||||
const alert = await this.alertCtrl.create({
|
||||
cssClass: 'success-alert',
|
||||
header: 'Success!',
|
||||
subHeader: `Your Embassy is set up and ready to go.`,
|
||||
backdropDismiss: false,
|
||||
buttons: [
|
||||
{
|
||||
text: 'Go To Embassy',
|
||||
handler: () => {
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
await alert.present()
|
||||
const loader = await this.loadingCtrl.create({
|
||||
message: 'Setting up your Embassy!'
|
||||
})
|
||||
|
||||
await loader.present()
|
||||
|
||||
this.stateService.embassyDrive = drive
|
||||
this.stateService.embassyPassword = ret.data.password
|
||||
|
||||
try {
|
||||
this.stateService.torAddress = (await this.stateService.setupEmbassy()).torAddress
|
||||
} catch (e) {
|
||||
console.log(e.message)
|
||||
} finally {
|
||||
loader.dismiss()
|
||||
if(!!this.stateService.recoveryDrive) {
|
||||
await this.navCtrl.navigateForward(`/loading`, { animationDirection: 'forward' })
|
||||
} else {
|
||||
await this.navCtrl.navigateForward(`/success`, { animationDirection: 'forward' })
|
||||
}
|
||||
}
|
||||
})
|
||||
await modal.present();
|
||||
|
||||
Reference in New Issue
Block a user