fix: show a channel by default if there is at least one
This commit is contained in:
parent
1b3314ea9a
commit
29b2bbf13e
|
@ -128,6 +128,9 @@ QtObject:
|
||||||
proc upsertChannel(self: ChatsView, channel: string) =
|
proc upsertChannel(self: ChatsView, channel: string) =
|
||||||
if not self.messageList.hasKey(channel):
|
if not self.messageList.hasKey(channel):
|
||||||
self.messageList[channel] = newChatMessageList(channel, self.status)
|
self.messageList[channel] = newChatMessageList(channel, self.status)
|
||||||
|
# If there is only one channel, set is as active
|
||||||
|
if (self.activeChannel.chatItem == nil and self.chats.rowCount() == 1):
|
||||||
|
self.setActiveChannelByIndex(0)
|
||||||
|
|
||||||
proc messagePushed*(self: ChatsView) {.signal.}
|
proc messagePushed*(self: ChatsView) {.signal.}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ QtObject:
|
||||||
return ens.userNameOrAlias(self.status.chat.contacts[pubKey])
|
return ens.userNameOrAlias(self.status.chat.contacts[pubKey])
|
||||||
generateAlias(pubKey)
|
generateAlias(pubKey)
|
||||||
|
|
||||||
method rowCount(self: ChannelsList, index: QModelIndex = nil): int = self.chats.len
|
method rowCount*(self: ChannelsList, index: QModelIndex = nil): int = self.chats.len
|
||||||
|
|
||||||
proc renderBlock(self: ChannelsList, message: Message): string
|
proc renderBlock(self: ChannelsList, message: Message): string
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue