Open nithinkvarrier opened 3 years ago
I had created a function onImageAdded() in vdropzone-file-added event
async onCoverImageAdded(upload) { console.log(upload); console.log(upload.accepted); if (upload.accepted) { console.log('valid image'); }else{ console.log('Invalid image'); } }
here upload.accepted condition always return undefined. But within a fraction of seconds 'upload' data got updated to accepted = true. If I'm adding setTimeout before the code it's working perfectly. Just like this
async onCoverImageAdded(upload) { setTimeout(async function() { console.log(upload); console.log(upload.accepted); if (upload.accepted) { console.log('valid image'); }else{ console.log('Invalid image'); } }, 0); }
How do I validate an image is valid before moving this into server?
Facing the same issue. Any solution?
I had created a function onImageAdded() in vdropzone-file-added event
here upload.accepted condition always return undefined. But within a fraction of seconds 'upload' data got updated to accepted = true. If I'm adding setTimeout before the code it's working perfectly. Just like this
How do I validate an image is valid before moving this into server?