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,25 +306,30 @@ export class AppShowPage {
}) })
} }
private async presentAlertStart (message: string): Promise<void> { private async presentAlertStart (message: string): Promise<boolean> {
const alert = await this.alertCtrl.create({ return new Promise(async resolve => {
header: 'Warning', const alert = await this.alertCtrl.create({
message, header: 'Warning',
buttons: [ message,
{ buttons: [
text: 'Cancel', {
role: 'cancel', text: 'Cancel',
}, role: 'cancel',
{ handler: () => {
text: 'Start', resolve(false)
handler: () => { },
this.start()
}, },
cssClass: 'enter-click', {
}, text: 'Continue',
], handler: () => {
resolve(true)
},
cssClass: 'enter-click',
},
],
})
await alert.present()
}) })
await alert.present()
} }
private async start (): Promise<void> { private async start (): Promise<void> {