Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why newFile.error is assigned on Automatic compression & image size in full example docs? #422

Open
lucianobosco opened this issue Feb 12, 2022 · 0 comments

Comments

@lucianobosco
Copy link

lucianobosco commented Feb 12, 2022

I was taking a look at full sample docs and found something odd.

if (newFile.file && newFile.error === "" && newFile.type.substr(0, 6) === 'image/' && this.autoCompress > 0 && this.autoCompress < newFile.size) {
          newFile.error = 'compressing'
          .......
if (newFile && newFile.error === '' && newFile.type.substr(0, 6) === "image/" && newFile.blob && (!oldFile || newFile.blob !== oldFile.blob)) {
        newFile.error = 'image parsing'
        .......

The question is: why are you assigning the .error property while processing the file? I'm pretending to show the file status but in this way, once the file is selected, my UI shows an error message while it's being processed.
I'm aware that this can be completely removed or handled in another way, but just wondering why do you do that.

Wouldn't be a better idea to have a file.processing property in order to achieve that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant