mirror of
https://github.com/aljazceru/hypergolic.git
synced 2026-02-23 06:14:19 +01:00
Merge pull request #117 from hzrd149/blossom-uploads
Improve upload error handling
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
if (file) {
|
||||
const blob = await uploadBlob(file, $userServers);
|
||||
|
||||
if (!blob) throw new Error('All servers failed');
|
||||
|
||||
// Insert the image URL into the textarea
|
||||
const insert = blob.url;
|
||||
const textarea = event.target as HTMLTextAreaElement;
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
try {
|
||||
dispatch('uploading');
|
||||
const blob = await uploadBlob(file, $userServers);
|
||||
|
||||
if (!blob) throw new Error('All servers failed');
|
||||
|
||||
dispatch('uploaded', blob);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) alert(`Failed to upload image: ${error.message}`);
|
||||
|
||||
Reference in New Issue
Block a user