From 449b8c0454604ceb8ffc8159203e64aff2c61dcb Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Thu, 16 Jul 2020 14:18:04 -0400 Subject: [PATCH] fix: open first chat on load --- src/app/chat/event_handling.nim | 3 +++ src/app/chat/view.nim | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/chat/event_handling.nim b/src/app/chat/event_handling.nim index 1e0540559b..a530020916 100644 --- a/src/app/chat/event_handling.nim +++ b/src/app/chat/event_handling.nim @@ -23,6 +23,9 @@ proc handleChatEvents(self: ChatController) = discard self.view.chats.addChatItemToList(channel.chat) self.status.chat.chatMessages(channel.chat.id) + self.status.events.on("chatsLoaded") do(e:Args): + self.view.setActiveChannelByIndex(0) + self.status.events.on("channelJoined") do(e: Args): var channel = ChannelArgs(e) discard self.view.chats.addChatItemToList(channel.chat) diff --git a/src/app/chat/view.nim b/src/app/chat/view.nim index 20eb82d1af..db534edf97 100644 --- a/src/app/chat/view.nim +++ b/src/app/chat/view.nim @@ -170,10 +170,6 @@ QtObject: if not self.messageList.hasKey(channel): self.messageList[channel] = newChatMessageList(channel, self.status) self.channelOpenTime[channel] = now().toTime.toUnix * 1000 - # If there is only one channel, set is as active - # if (self.activeChannel.chatItem == nil and self.chats.rowCount() == 1): - # self.setActiveChannelByIndex(0) - # RRAMOS: commented because it was hanging the app on login proc messagePushed*(self: ChatsView) {.signal.}