ionic-deploy + ngx-image-cropper: image not displaying after relaunching app

130 Views Asked by At

This is such a strange issue so just posting in case anywhere knows where to investigate next as I'm completely stumped.

I have a Cordova Ionic (v6) app that uses ngx-image-cropper npm plugin to crop images.

If I run the app without ionic-deploy, the ngx-image-cropper plugin works perfect. You select an image, the image shows up, you crop it & I upload the cropped image. If I close the app out of the background & open it back up, still works as normal.

If I run the app with ionic-deploy it goes as follows:

  1. App opens up, grabs newest version from code-deploy, applies it and the image cropper works as expected still.
  2. This is where it gets weird: If I close the app out of the background and open it back up, it's still on the same code-deploy version so there's nothing new to download/apply, however when the image-cropper gets the imageChangedEvent, the image doesn't show up on the cropper.

I'm baffled at what is happening, I've checked in Safari Develop console log & there's no error messages.

I put a bunch of console logs throughout and they all seem normal (passing the image around, file input change events, etc.

Does anyone have any idea what to look into next?

EDIT: I noticed on the first launch when it works vs the 2nd launch when it doesn't work the base64 being inserted into the image-cropper is different...

enter image description here

UPDATE: I changed my code to match what this comment showed and now it works.... it's going veryyyyyy slow and acting buggy but it works.. I will look into this more on Monday but for anyone that stumbles across this: https://github.com/danielsogl/awesome-cordova-plugins/issues/505#issuecomment-1110622354

0

There are 0 best solutions below