feat: file upload error handling

This commit is contained in:
Timothy J. Baek 2024-01-07 09:33:34 -08:00
parent b37b157638
commit 9a63376e55
3 changed files with 91 additions and 42 deletions

View file

@ -124,6 +124,14 @@
} else if (messages.length != 0 && messages.at(-1).done != true) {
// Response not done
console.log('wait');
} else if (
files.length > 0 &&
files.filter((file) => file.upload_status === false).length > 0
) {
// Upload not done
toast.error(
`Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.`
);
} else {
// Reset chat message textarea height
document.getElementById('chat-textarea').style.height = '';