-
Notifications
You must be signed in to change notification settings - Fork 74
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 file upload #556 #558
base: dev
Are you sure you want to change the base?
Fix file upload #556 #558
Conversation
The last 2 points would be worth a PR in nostr-editor eventually. |
That all makes sense, we've needed to add errors to file uploads for a long time. Is there a way to get the error from nostr-editor when an upload fails and show it? Feel free to approach this problem however you like, either via PR to nostr-editor/@welshman/editor or directly here. |
1d66ab8
to
77a4cce
Compare
src/app/editor/index.ts
Outdated
@@ -75,6 +88,11 @@ export const getEditor = ({ | |||
onComplete() { | |||
uploading?.set(false) | |||
}, | |||
onUploadError(currentEditor, file) { | |||
removeBlobs(currentEditor as Editor) |
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.
This should work fine, but ideally it would be targeted to the specific file that failed. Otherwise, if there are multiple concurrent uploads and one fails, the other will get removed as well too right?
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.
Yes that's right, onUploadFail gives me the file that failed so it should be possible to remove just this one
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.
nostr-editor keep an uploadError attribute on each node. I have added an errorsOnly attribute to the removeBlobs command that will only remove blobs in an error state.
- add the upload url to the error message
|
abbf33c
to
6405818
Compare
once the PR is merged in nostr-editor, we will be able to remove some code here too. |
A few things here: