From 37dda4333dc9b63e6a59568ee5326e0b542e2a08 Mon Sep 17 00:00:00 2001 From: josc146 Date: Sun, 5 Nov 2023 21:05:06 +0800 Subject: [PATCH] chat attachment is now related to single message --- frontend/src/pages/Chat.tsx | 62 ++++++++++++++++++++---------- frontend/src/stores/commonStore.ts | 26 ++++++++----- 2 files changed, 59 insertions(+), 29 deletions(-) diff --git a/frontend/src/pages/Chat.tsx b/frontend/src/pages/Chat.tsx index b5c9f1d..05d66ce 100644 --- a/frontend/src/pages/Chat.tsx +++ b/frontend/src/pages/Chat.tsx @@ -91,6 +91,7 @@ const MoreUtilsButton: FC<{ uuid: string, setEditing: (editing: boolean) => void onClick={() => { commonStore.conversationOrder.splice(commonStore.conversationOrder.indexOf(uuid), 1); delete commonStore.conversation[uuid]; + commonStore.setAttachment(uuid, null); }} /> ; @@ -157,7 +158,21 @@ const ChatMessageItem: FC<{ )} > {!editing ? - {messageItem.content} : +
+ {messageItem.content} + {uuid in commonStore.attachments && +
+
+ +
+ } +
: