fix: open first chat on load

This commit is contained in:
Richard Ramos 2020-07-16 14:18:04 -04:00 committed by Iuri Matias
parent 4fae0eb100
commit 449b8c0454
2 changed files with 3 additions and 4 deletions

View File

@ -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)

View File

@ -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.}