-
Notifications
You must be signed in to change notification settings - Fork 125
TUS: Move logic from UploadPage to a standalone hook #13606
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
Conversation
|
| audiusSdk, | ||
| userId, | ||
| wallet, | ||
| userId: userId!, |
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.
we throw an err above on missing userId/wallet, maybe should do the same
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.
We check inside the hook so that we don't error on render but error when you call the mutation
| ) | ||
| } | ||
|
|
||
| const getTrackArtworkUploadHandles = async ( |
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.
handle is also overloaded, maybe handler? or just getTrackArtworkUploadTask?
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.
yeah true. luckily these aren't exported so hopefully clear in context? Task feels fine though too, down to rename in a later pr (don't want to muck the rebasing)
| ) | ||
|
|
||
| return { startUpload, finishUpload } | ||
| } |
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.
love this file
67f8c16
into
mjp-tus-edit-replace-audio
Moves all the upload logic from UploadPage into its own hook that can be shared with mobile