mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 05:52:41 +00:00
fix: fix community channel color undefined issue
This commit is contained in:
parent
7e8dc8c5d1
commit
2f8d46fa76
@ -100,7 +100,10 @@ QtObject:
|
|||||||
|
|
||||||
proc getChannelById*(self: ChatsView, channel: string): Chat =
|
proc getChannelById*(self: ChatsView, channel: string): Chat =
|
||||||
if (self.communities.activeCommunity.active):
|
if (self.communities.activeCommunity.active):
|
||||||
return self.communities.activeCommunity.chats.getChannel(self.communities.activeCommunity.chats.chats.findIndexById(channel))
|
let index = self.communities.activeCommunity.chats.chats.findIndexById(channel)
|
||||||
|
if (index == -1):
|
||||||
|
return
|
||||||
|
return self.communities.activeCommunity.chats.getChannel(index)
|
||||||
else:
|
else:
|
||||||
return self.chats.getChannel(self.chats.chats.findIndexById(channel))
|
return self.chats.getChannel(self.chats.chats.findIndexById(channel))
|
||||||
|
|
||||||
@ -146,7 +149,7 @@ QtObject:
|
|||||||
proc getChannelColor*(self: ChatsView, channel: string): string {.slot.} =
|
proc getChannelColor*(self: ChatsView, channel: string): string {.slot.} =
|
||||||
if (channel == ""): return
|
if (channel == ""): return
|
||||||
let selectedChannel = self.getChannelById(channel)
|
let selectedChannel = self.getChannelById(channel)
|
||||||
if (selectedChannel.id == "") : return
|
if (selectedChannel.isNil or selectedChannel.id == "") : return
|
||||||
return selectedChannel.color
|
return selectedChannel.color
|
||||||
|
|
||||||
proc replaceMentionsWithPubKeys(self: ChatsView, mentions: seq[string], contacts: seq[Profile], message: string, predicate: proc (contact: Profile): string): string =
|
proc replaceMentionsWithPubKeys(self: ChatsView, mentions: seq[string], contacts: seq[Profile], message: string, predicate: proc (contact: Profile): string): string =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user