diff --git a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts index a78f1349a..f870c2b50 100644 --- a/ui/src/app/pages/apps-routes/app-show/app-show.page.ts +++ b/ui/src/app/pages/apps-routes/app-show/app-show.page.ts @@ -173,12 +173,19 @@ export class AppShowPage { } async tryStart (): Promise { - const message = this.pkg.manifest.alerts.start - if (message) { - this.presentAlertStart(message) - } else { - this.start() + if (this.dependencies.some(d => !!d.errorText)) { + const depErrMsg = `${this.pkg.manifest.title} has dependencies errors. It may not work as expected.` + const proceed = await this.presentAlertStart(depErrMsg) + if (!proceed) return } + + const alertMsg = this.pkg.manifest.alerts.start + if (!!alertMsg) { + const proceed = await this.presentAlertStart(alertMsg) + if (!proceed) return + } + + this.start() } async donate (): Promise { @@ -299,25 +306,30 @@ export class AppShowPage { }) } - private async presentAlertStart (message: string): Promise { - const alert = await this.alertCtrl.create({ - header: 'Warning', - message, - buttons: [ - { - text: 'Cancel', - role: 'cancel', - }, - { - text: 'Start', - handler: () => { - this.start() + private async presentAlertStart (message: string): Promise { + return new Promise(async resolve => { + const alert = await this.alertCtrl.create({ + header: 'Warning', + message, + buttons: [ + { + text: 'Cancel', + role: 'cancel', + handler: () => { + resolve(false) + }, }, - cssClass: 'enter-click', - }, - ], + { + text: 'Continue', + handler: () => { + resolve(true) + }, + cssClass: 'enter-click', + }, + ], + }) + await alert.present() }) - await alert.present() } private async start (): Promise {