Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: handle errors in attachment manager

Abdullah Atta2576f1dd0073
diff --git a/apps/web/src/dialogs/attachments-dialog.tsx b/apps/web/src/dialogs/attachments-dialog.tsx
index 86e65d4ac..b40ffa3ba 100644
--- a/apps/web/src/dialogs/attachments-dialog.tsx
+++ b/apps/web/src/dialogs/attachments-dialog.tsx
@@ -197,14 +197,15 @@ export const AttachmentsDialog = DialogManager.register(
variant="secondary"
key={tool.title}
title={tool.title}
- onClick={() =>
- tool.onClick({
- selected
- // : attachments.filter(
- // (a) => selected.indexOf(a.id) > -1
- // )
- })
- }
+ onClick={() => {
+ try {
+ tool.onClick({
+ selected
+ });
+ } catch (e) {
+ showToast("error", (e as Error).message);
+ }
+ }}
disabled={!selected.length}
sx={{ bg: "transparent", p: 1 }}
>