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

Fix for error when cancel uploading before success #91

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Jerome-1010
Copy link

Since this.placeholderDelta is updated only when the image upload is successful, the following two problems were occurring.

  1. If the process was aborted before a successful upload, calculartePlaceholderInsertLength would refer to null properties and generate an error. 6ebbba7
  2. this.placeholderDelta was never reset, so this.placeholderDelta obtained during the last upload could be referenced at the next upload timing. 365cc47

These errors occur when the following functions are passed to the upload property.

options: {
  upload: async (file) => {
    if (file.size > 10 * 1024 * 1024) {
      throw new Error('A file size exceeded!');
    }
    return uploadFunc(file);
  },
},

@maykon-oliveira
Copy link

Close #38

@victorLessa
Copy link

The problem that this PR intends to solve avoids the need to force the solution presented above, not every case is resolved with the previously suggested behavior

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

Successfully merging this pull request may close these issues.

3 participants