diff --git a/src/components/nostr/ChatComponent.vue b/src/components/nostr/ChatComponent.vue index 7757778..e48cdd1 100644 --- a/src/components/nostr/ChatComponent.vue +++ b/src/components/nostr/ChatComponent.vue @@ -421,7 +421,10 @@ const { // Computed const currentMessages = computed(() => { if (!selectedPeer.value) return [] - return messages.value.get(selectedPeer.value.pubkey) || [] + const peerMessages = messages.value.get(selectedPeer.value.pubkey) || [] + + // Sort messages by timestamp (oldest first) to ensure chronological order + return [...peerMessages].sort((a, b) => a.created_at - b.created_at) }) // Sort peers by latest message timestamp (newest first) and unread status