This commit is contained in:
Matt Hill
2021-11-23 13:20:58 -07:00
committed by Aiden McClelland
parent d4b41f3163
commit 2d2d390ff0

View File

@@ -173,12 +173,19 @@ export class AppShowPage {
} }
async tryStart (): Promise<void> { async tryStart (): Promise<void> {
const message = this.pkg.manifest.alerts.start if (this.dependencies.some(d => !!d.errorText)) {
if (message) { const depErrMsg = `${this.pkg.manifest.title} has dependencies errors. It may not work as expected.`
this.presentAlertStart(message) const proceed = await this.presentAlertStart(depErrMsg)
} else { if (!proceed) return
this.start()
} }
const alertMsg = this.pkg.manifest.alerts.start
if (!!alertMsg) {
const proceed = await this.presentAlertStart(alertMsg)
if (!proceed) return
}
this.start()
} }
async donate (): Promise<void> { async donate (): Promise<void> {
@@ -299,7 +306,8 @@ export class AppShowPage {
}) })
} }
private async presentAlertStart (message: string): Promise<void> { private async presentAlertStart (message: string): Promise<boolean> {
return new Promise(async resolve => {
const alert = await this.alertCtrl.create({ const alert = await this.alertCtrl.create({
header: 'Warning', header: 'Warning',
message, message,
@@ -307,17 +315,21 @@ export class AppShowPage {
{ {
text: 'Cancel', text: 'Cancel',
role: 'cancel', role: 'cancel',
handler: () => {
resolve(false)
},
}, },
{ {
text: 'Start', text: 'Continue',
handler: () => { handler: () => {
this.start() resolve(true)
}, },
cssClass: 'enter-click', cssClass: 'enter-click',
}, },
], ],
}) })
await alert.present() await alert.present()
})
} }
private async start (): Promise<void> { private async start (): Promise<void> {