From 324ba15b2f967990e0630ce4a8a7eac8e34d7335 Mon Sep 17 00:00:00 2001
From: Jono Wenger <jono@elixxir.io>
Date: Wed, 27 Jul 2022 11:31:34 -0700
Subject: [PATCH] Make chats show up when a connection is made and not when the
 initial message is received

---
 cmd/utils.go | 2 +-
 ui/chats.go  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/cmd/utils.go b/cmd/utils.go
index bfa8e58..6a16bc0 100644
--- a/cmd/utils.go
+++ b/cmd/utils.go
@@ -59,7 +59,7 @@ func runTestUI() {
 		l1.Hear(receive.Message{
 			MessageType: 1,
 			ID:          cryptoE2e.MessageID{},
-			Payload:     []byte("My name is Sally. 1 abortion please!"),
+			Payload:     []byte("Hello this is a test."),
 			Sender:      partnerID,
 			RecipientID: myID,
 			Timestamp:   netTime.Now(),
diff --git a/ui/chats.go b/ui/chats.go
index e4ba2e7..05e20c9 100644
--- a/ui/chats.go
+++ b/ui/chats.go
@@ -56,6 +56,9 @@ func (cs *Chats) Add(receivedMsgChan chan []byte, sendFn SendMessage,
 		maxMessageLen:   maxMessageLen,
 		unread:          true,
 	}
+
+	cs.updateFeed <- struct{}{}
+	go cs.UpdateChatList(cs.nextIndex)
 	go cs.chats[cs.nextIndex].updateChatFeed(cs.updateFeed, cs.UpdateChatList)
 	cs.nextIndex++
 }
-- 
GitLab