You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uploader: {uploadByFile(file){returnnewPromise((resolve,reject)=>{// e.g. checking file size, almost synchronous // Pass a file with a size larger than 1024 (1kb)if(file.size>1024){resolve({success: 0});}else{// ... go on}});},}
In this case, Preloader is meaninglessly being hidden first by hidePreloader following uploadingFailed,
then shown up by showPreloader following FileReader.onload (because it takes longer than the previous one)
As a result, Preloader keeps appearing despite uploading process is already over.
How to fix the bug:
Promisify FileReader and do upload after awaiting FileReader.onload
I'll send a pull request including the fix commits about this issue.
The text was updated successfully, but these errors were encountered:
orionmiz
changed the title
[Bug] Preloader doesn't guarantee order of showing or hiding
[Bug] Preloader doesn't ensure order of showing or hiding
Jun 6, 2022
Hello all... this is still an issue. If a custom uploader rejects before the preview is shown; the preview is not dismissed. #185 seams to fix this. Any chance of getting this PR cleanup and merged?
How to reproduce the bug in a custom uploader:
In this case, Preloader is meaninglessly being hidden first by
hidePreloader
followinguploadingFailed
,then shown up by
showPreloader
followingFileReader.onload
(because it takes longer than the previous one)As a result, Preloader keeps appearing despite uploading process is already over.
How to fix the bug:
Promisify
FileReader
and do upload after awaitingFileReader.onload
I'll send a pull request including the fix commits about this issue.
The text was updated successfully, but these errors were encountered: