bug: undefined on adding attachment to empty input
This commit is contained in:
@ -48,7 +48,7 @@ export function NoteCreator(props: NoteCreatorProps) {
|
|||||||
if (file) {
|
if (file) {
|
||||||
let rx = await uploader.upload(file, file.name);
|
let rx = await uploader.upload(file, file.name);
|
||||||
if (rx.url) {
|
if (rx.url) {
|
||||||
setNote(n => `${n}\n${rx.url}`);
|
setNote(n => `${n ? `${n}\n` : ""}${rx.url}`);
|
||||||
} else if (rx?.error) {
|
} else if (rx?.error) {
|
||||||
setError(rx.error);
|
setError(rx.error);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user