-
Notifications
You must be signed in to change notification settings - Fork 296
Fix profile pic banner pic upload #2614
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 profile pic banner pic upload #2614
Conversation
This looks right to me! |
although nostr.build supports uploads without auth right? was it not working because the image was too large? |
I thought it would support but as of now, the following is the response sent by nostr-build There is one more commit that limits the profile and banner upload to image only and sets selection quantity to 1 |
damus/Views/MediaPicker.swift
Outdated
if case .postView = mediaPickerEntry { | ||
configuration.selectionLimit = 0 // Allows multiple media selection | ||
configuration.filter = .any(of: [.images, .videos]) | ||
configuration.selection = .ordered // images are returned in the order they were selected + numbered badge displayed | ||
} else if case .editPictureControl = mediaPickerEntry { | ||
configuration.selectionLimit = 1 // Allows one media selection | ||
configuration.filter = .images | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use switch statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jb55 I have made the update
Use Switch statement to address all cases instead of if-else Signed-off-by: Swift Coder <[email protected]>
Summary
The existing picture-upload flow for Profile and Banner is broken. Root cause analysis of this bug is due to missing KeyPair parameter being passed while instantiating EditPictureControl objects. They KeyPair param is used to create nip98 signature and which is eventually used to create an "Authorization" header for creating an upload request.
Checklist
Closes:
orFixes:
tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patches