A
A
Artem00712018-09-02 21:12:40
Apache Cordova
Artem0071, 2018-09-02 21:12:40

Finally not working in Cordova?

I can't figure out why the code doesn't work:

this.doMagic() // <- тут Promise который выкидывает reject
      .then(_ => {
        alert('test 1') // <- это не срабатывает
      })
      .catch(_ => {
        alert('test 2') // <- это срабатывает
      })
      .finally(_ => {
        alert('test 3') // <- это тоже не срабатывает (ХОТЯ ДОЛЖНО)
      })

Everything works fine in the browser, but as soon as you start the emulator, 'test 3' doesn't work and that's it
. At first I thought that MB didn't work because of alerta, but no. If you put more alerts in the catch, then everything will work
. In general, I have 2 assumptions:
1) Cordova does not support finally
2) I'm messing around hard somewhere and don't understand what's going on
Where is the truth?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Sivakov, 2018-09-03
@yar3333

I think that the problem is not in Cordova itself, but in the browser engine on which you run it. If suddenly you are not using crosswalk yet, then use it, and the problem will most likely be solved. Along with a bunch of others :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question