From e28e98a394e4f72e6599b353ed94ace8e0c6d8cd Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 1 Mar 2021 14:00:51 -0500 Subject: [PATCH] fix: fix community rebase errors --- src/app/chat/view.nim | 6 +++--- ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml | 2 +- ui/app/AppLayouts/Chat/CommunityColumn.qml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/chat/view.nim b/src/app/chat/view.nim index 9400ffc38d..e0e84372da 100644 --- a/src/app/chat/view.nim +++ b/src/app/chat/view.nim @@ -67,7 +67,6 @@ QtObject: self.transactions.delete self.messageList = initOrderedTable[string, ChatMessageList]() self.communities.delete - self.messageList = initTable[string, ChatMessageList]() self.channelOpenTime = initTable[string, int64]() self.QAbstractListModel.delete @@ -228,7 +227,8 @@ QtObject: proc setActiveChannelByIndexWithForce*(self: ChatsView, index: int, forceUpdate: bool) {.slot.} = if((self.communities.activeCommunity.active and self.communities.activeCommunity.chats.chats.len == 0) or (not self.communities.activeCommunity.active and self.chats.chats.len == 0)): return - let selectedChannel = + + var selectedChannel = if (self.communities.activeCommunity.active): self.communities.activeCommunity.chats.getChannel(index) else: @@ -723,6 +723,6 @@ QtObject: proc getMessageListIndex(self: ChatsView):int {.slot.} = var idx = -1 for msg in toSeq(self.messageList.values): - if(self.activeChannel.id == msg.id): return idx idx = idx + 1 + if(self.activeChannel.id == msg.id): return idx return idx diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml index b309cb1c42..44badf0b5d 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml @@ -258,7 +258,7 @@ ScrollView { DelegateModelGeneralized { id: messageListDelegate - property var lessThan: [ + lessThan: [ function(left, right) { return left.clock > right.clock } ] diff --git a/ui/app/AppLayouts/Chat/CommunityColumn.qml b/ui/app/AppLayouts/Chat/CommunityColumn.qml index 9a73c87267..79f751ef23 100644 --- a/ui/app/AppLayouts/Chat/CommunityColumn.qml +++ b/ui/app/AppLayouts/Chat/CommunityColumn.qml @@ -57,7 +57,7 @@ Item { y: optionsBtn.height Action { - enabled: chatsModel.activeCommunity.admin + enabled: chatsModel.communities.activeCommunity.admin //% "Create channel" text: qsTrId("create-channel") icon.source: "../../img/hash.svg"