diff --git a/src/components/AccountButton.vue b/src/components/AccountButton.vue
index 4255c52..f580e7a 100644
--- a/src/components/AccountButton.vue
+++ b/src/components/AccountButton.vue
@@ -26,7 +26,7 @@
>
-
{{ account.address.value }}
+
{{ account.address.value }}
-
-
+
+
{{ attachment.title }}
-
+
{{ hint }}
-
@@ -58,6 +64,7 @@
import { ref } from 'vue';
import { processFile } from 'src/utils/attachments';
import { MessageAttachment, SendMessageParams } from 'src/types/chats';
+import { useQuasar } from 'quasar';
const props = defineProps({
isLoading: {
@@ -70,6 +77,8 @@ const props = defineProps({
},
});
+const $q = useQuasar();
+
const emit = defineEmits<{ sendMessage: [value: SendMessageParams] }>();
// Values
@@ -82,12 +91,22 @@ const processMessageAttachments = async (event: any) => {
await Promise.all(
Array.from(target.files as FileList).map(async (file) => {
- // TODO: handle processing error
- const fileData = await processFile(file);
- attachmentsData.push(fileData);
+ try {
+ const fileData = await processFile(file);
+ attachmentsData.push(fileData);
+ } catch (error) {
+ $q.notify({
+ message: (error as Error)?.message ?? 'File processing failed, please try again',
+ color: 'red',
+ });
+ }
}),
);
- attachments.value = attachmentsData;
+ attachments.value = attachments.value.concat(attachmentsData);
+};
+
+const removeAttachment = (attachmentId: string) => {
+ attachments.value = attachments.value.filter((a) => a.id !== attachmentId);
};
const sendMessage = (event: Event | KeyboardEvent) => {
diff --git a/src/components/PersonaDialog.vue b/src/components/PersonaDialog.vue
index cd62265..abfce6c 100644
--- a/src/components/PersonaDialog.vue
+++ b/src/components/PersonaDialog.vue
@@ -39,11 +39,11 @@
/>
-
+
diff --git a/src/components/UserSettingsDialog.vue b/src/components/UserSettingsDialog.vue
index 8a68824..d0d0672 100644
--- a/src/components/UserSettingsDialog.vue
+++ b/src/components/UserSettingsDialog.vue
@@ -34,11 +34,11 @@
-
+
-
+
@@ -75,7 +75,7 @@
@@ -100,7 +100,7 @@
{{ attachment.title }}
-
+
-