diff --git a/frontend/src/lib/components/MessageBubble.svelte b/frontend/src/lib/components/MessageBubble.svelte index 462d30c..d246a7c 100644 --- a/frontend/src/lib/components/MessageBubble.svelte +++ b/frontend/src/lib/components/MessageBubble.svelte @@ -12,6 +12,7 @@ import Reactions from "#lib/components/Reactions.svelte"; import ReplyHeader from "#lib/components/ReplyHeader.svelte"; import MessageReadItem from "#lib/components/read/MessageReadItem.svelte"; + import SavedItem from "#lib/components/SavedItem.svelte"; import Avatar from "#lib/components/ui/Avatar.svelte"; import ContextMenu from "#lib/components/ui/ContextMenu.svelte"; import ContextMenuItem from "#lib/components/ui/ContextMenuItem.svelte"; @@ -333,13 +334,11 @@ > {/if} {#if savedUi.available && !savedUi.isSavedChat(message.chat_id)} - savedUi.forward(message.chat_id, message.message_id)} - >{message.deleted_at || message.is_self_destruct - ? t("saved.copy") - : t("saved.forward")} + {/if} (null); let file = $state(null); let caption = $state(""); let voice = $state(false); @@ -49,11 +50,13 @@ return; } sending = true; - if (await savedUi.send({ text: message })) { + const result = await savedUi.send({ text: message }); + sending = false; + failure = result.ok ? null : t(result.label); + if (result.ok) { text = ""; requestAnimationFrame(fit); } - sending = false; } async function sendFile() { @@ -61,13 +64,14 @@ return; } sending = true; - const sent = await savedUi.send({ + const result = await savedUi.send({ file, text: caption.trim(), voice: isAudio && voice, }); sending = false; - if (sent) { + failure = result.ok ? null : t(result.label); + if (result.ok) { file = null; caption = ""; } @@ -97,6 +101,7 @@ function onOpenChange(open: boolean) { if (!(open || sending)) { + failure = null; if (!text) { text = caption; } @@ -108,6 +113,9 @@
+ {#if failure && !file} +

{failure}

+ {/if}