mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-18 17:49:00 +00:00
fix: going to the previous channel when the community has no channel
This commit is contained in:
parent
63e2c21b33
commit
941e9565ab
@ -226,9 +226,8 @@ QtObject:
|
|||||||
if not response.hasKey("error"):
|
if not response.hasKey("error"):
|
||||||
self.chats.clearUnreadMessagesCount(channel)
|
self.chats.clearUnreadMessagesCount(channel)
|
||||||
|
|
||||||
proc setActiveChannelByIndex*(self: ChatsView, index: int) {.slot.} =
|
proc setActiveChannelByIndex*(self: ChatsView, index: int, forceUpdate: bool = false) {.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
|
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 =
|
let selectedChannel =
|
||||||
if (self.communities.activeCommunity.active):
|
if (self.communities.activeCommunity.active):
|
||||||
self.communities.activeCommunity.chats.getChannel(index)
|
self.communities.activeCommunity.chats.getChannel(index)
|
||||||
@ -242,7 +241,7 @@ QtObject:
|
|||||||
self.communities.activeCommunity.communityItem.lastChannelSeen = selectedChannel.id
|
self.communities.activeCommunity.communityItem.lastChannelSeen = selectedChannel.id
|
||||||
self.communities.joinedCommunityList.replaceCommunity(self.communities.activeCommunity.communityItem)
|
self.communities.joinedCommunityList.replaceCommunity(self.communities.activeCommunity.communityItem)
|
||||||
|
|
||||||
if self.activeChannel.id == selectedChannel.id: return
|
if not forceUpdate and self.activeChannel.id == selectedChannel.id: return
|
||||||
|
|
||||||
if selectedChannel.chatType.isOneToOne and selectedChannel.id == selectedChannel.name:
|
if selectedChannel.chatType.isOneToOne and selectedChannel.id == selectedChannel.name:
|
||||||
selectedChannel.name = self.userNameOrAlias(selectedChannel.id)
|
selectedChannel.name = self.userNameOrAlias(selectedChannel.id)
|
||||||
@ -306,7 +305,7 @@ QtObject:
|
|||||||
|
|
||||||
proc restorePreviousActiveChannel*(self: ChatsView) {.slot.} =
|
proc restorePreviousActiveChannel*(self: ChatsView) {.slot.} =
|
||||||
if self.previousActiveChannelIndex != -1:
|
if self.previousActiveChannelIndex != -1:
|
||||||
self.setActiveChannelByIndex(self.previousActiveChannelIndex)
|
self.setActiveChannelByIndex(self.previousActiveChannelIndex, true)
|
||||||
|
|
||||||
proc getCurrentSuggestions(self: ChatsView): QVariant {.slot.} =
|
proc getCurrentSuggestions(self: ChatsView): QVariant {.slot.} =
|
||||||
return newQVariant(self.currentSuggestions)
|
return newQVariant(self.currentSuggestions)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user