From a62fafc3088676ce626e69ff52d75adf1d453197 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Tue, 2 May 2023 09:07:28 -0400 Subject: [PATCH] Always have a chat. --- chatlistmodel.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chatlistmodel.h b/chatlistmodel.h index 1242cbba..d5ad10ce 100644 --- a/chatlistmodel.h +++ b/chatlistmodel.h @@ -78,8 +78,12 @@ public: return; } - const bool chatIsCurrent = chat == m_currentChat; emit disconnectChat(chat); + if (chat == m_newChat) { + m_newChat->disconnect(this); + m_newChat = nullptr; + } + const int index = m_chats.indexOf(chat); if (m_chats.count() < 2) { addChat();