Open Jerome-1010 opened 1 year ago
Since this.placeholderDelta is updated only when the image upload is successful, the following two problems were occurring.
this.placeholderDelta
calculartePlaceholderInsertLength
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); }, },
Close #38
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
Since
this.placeholderDelta
is updated only when the image upload is successful, the following two problems were occurring.calculartePlaceholderInsertLength
would refer to null properties and generate an error. https://github.com/NoelOConnell/quill-image-uploader/commit/6ebbba718b8829c637d9ccb1740bd216c1fb370cthis.placeholderDelta
was never reset, sothis.placeholderDelta
obtained during the last upload could be referenced at the next upload timing. https://github.com/NoelOConnell/quill-image-uploader/commit/365cc4757363b547acb79a07d985d736985adc12These errors occur when the following functions are passed to the upload property.