GetTerminus / terminus-ui

📚 The Terminus UI Library.
MIT License
53 stars 8 forks source link

TsSelectedFile: Incorrectly reading files causes errors that kill the fileLoaded$ stream #1094

Open benjamincharity opened 6 years ago

benjamincharity commented 6 years ago

It seems that calling FileReader.readAsDataURL() on a file that is not an image causes an error that breaks the stream.

It is likely that we should call FileReader.readAsText() when dealing with non-image files.

Call in question: https://github.com/GetTerminus/terminus-ui/blob/master/terminus-ui/file-upload/src/selected-file.ts#L217

Need to wrap in if to call the correct method for the type of file.

shani-terminus commented 5 years ago

This is the branch I have been using: https://github.com/GetTerminus/terminus-ui/tree/1094-fileupload-non-image-breaking-stream

shani-terminus commented 5 years ago

Moving to Backlog and labeling On hold

Since TsFileUpload was built to support only one file, we're going to restructure the whole component, #1365.

In the meantime, Core is hacking around this problem, so it's not an active problem.