Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49313

Why does modalController.create promise don't seem to finish when running in android

$
0
0

I created this code snippet to simplify the code

async handleAddDevice() {
    try {
      const modal = await this.modalCtrl.create({
        component: CreateEditDevicePage,
      });
      // if i write some code on this line it is not being called, same goes with modal.present()
      this.toastHelper.presentToast({
        message: 'before present'
      })
      modal.present()
    } catch (error) {
      // this line doesn't get called
      this.toastHelper.presentToast({
        message: 'catch triggered'
      })
    } finally {
      // this line doesn't get called
      this.toastHelper.presentToast({
        message: 'try catch ended'
      })
    }
  }

Catch and finally here are not being triggered on android but is working correctly on web, and I am not able to try it on ios

I have this feeling that somewhere inside the create function a promise doesn’t get resolved but not quite sure how.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>