Allow only images in modal image uploader. #7672
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#7672
Loading…
Reference in a new issue
No description provided.
Delete branch "7646-in-the-cover-upload-modal-trying-to-upload-anything-other-than-an-image-doesnt-reset-the-form"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes
Issue Number: https://github.com/lbryio/lbry-desktop/issues/7646
What is the current behavior?
Even though a file filter is being used, the "All Files"
option allows users to select any file when uploading
an image.
What is the new behavior?
The electron filter is being used so the "All Files"
option is no longer displayed.
Other information
PR Checklist
Toggle...
What kind of change does this PR introduce?
Please check all that apply to this PR using "x":
I'm concerned that changing this from { path } to file will break publishing. Did you try?
b9be8d9f3a/ui/component/publishFile/view.jsx (L273)
expects file.path on electron because the sdk needs the path.It may be good to send { file: file , path: path } and adjust all the functions assigned to onFileChosen to take that.
Sounds good @jessopb, nice catch. Perhaps as a small note for the future, we should avoid using these union types. Notice how I'm still respecting the interface (by sending a
File
type) but still, it manages to break parts of the app...You're probably right. The union types were originally added when the codebase was supporting both web and app.
Maybe the type should be ChosenFile = { file: WebFile, path: string }
@jessopb I have updated the code so the
File
now contains apath
and amime
type. With this, the file upload for posts works fine. Please let me know what you think. Thanks.This was an elegant solution, but I think WebFile is a well defined builtin type and probably shouldn't be polluted with extra params. I think we'd prefer { file: FILE, path: path }
Sorry it took a while to get to this. Tested publish and it's broken.
Also breaks here on file drop. This should be a path.
Did you try publishing? Publish is trying to send an empty {}. (What happens when { thing: undefined })
One small snag.
this blocks
jpeg
- possibly some other valid types. svg has been possible and allowed so far.