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