bug: undefined on adding attachment to empty input

This commit is contained in:
Kieran 2023-01-29 22:50:22 +00:00
parent 8e829bcf52
commit 6e34d101c9
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -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);
}