Since the saving of the image is done asynchronously in a node module it invokes the .done() method before the file has been successfully downloaded. This causes problems when trying to refresh the preview panel and the image hasn't finished saving yet.
A quick hack was to introduce an arbitrary 3 second delay using setTimeout() to give the operation time to complete, but this is not the correct way to do it.
Since the saving of the image is done asynchronously in a node module it invokes the
.done()
method before the file has been successfully downloaded. This causes problems when trying to refresh the preview panel and the image hasn't finished saving yet.A quick hack was to introduce an arbitrary 3 second delay using
setTimeout()
to give the operation time to complete, but this is not the correct way to do it.