+
{message.type} | {message.sender}
{message.timestamp}
-
{message.text}
+
{message.text}
+
+
+ {#if message.composite}
+
+
+
+ {/if}
{/each}
diff --git a/src/lib/services/messages.ts b/src/lib/services/messages.ts
index 6a13cfb..a7883f3 100644
--- a/src/lib/services/messages.ts
+++ b/src/lib/services/messages.ts
@@ -28,8 +28,10 @@ export interface Message {
timestamp: string;
sender: string;
type: string;
+ composite?: object | null; // New field
}
+
// Load messages from localStorage or set an empty array if not available
const initialMessages = getFromLocalStorage('chat-messages', []);
@@ -48,11 +50,11 @@ export function createMessage(messageData) {
text: messageData.text,
timestamp: currentDate,
sender: messageData.sender,
- type: messageData.type
+ type: messageData.type,
+ composite: messageData.composite || null // New field
};
messages.update(oldMessages => [...oldMessages, newMessageObj]);
}
-
export function clearMessages() {
messages.set([]);
}