Fixed: starting a group chat shouldn't show the section to fetch more messages.
This commit is contained in:
parent
6f55c51ff2
commit
7255dcd256
|
@ -171,6 +171,13 @@ QtObject:
|
|||
proc muted*(self: ChatItemView): bool {.slot.} =
|
||||
return ?.self.chatItem.muted
|
||||
|
||||
proc joined*(self: ChatItemView): string {.slot.} =
|
||||
if self.chatItem.isNil: return ""
|
||||
return $self.chatItem.joined
|
||||
|
||||
QtProperty[string] joined:
|
||||
read = joined
|
||||
|
||||
QtProperty[bool] muted:
|
||||
read = muted
|
||||
notify = mutedChanged
|
||||
|
|
|
@ -283,14 +283,21 @@ Item {
|
|||
id: fetchMoreMessagesButtonComponent
|
||||
Item {
|
||||
id: wrapper
|
||||
property int gapNowAndOldest: nextMessageIndex > -1 ? (Date.now() / 1000 - nextMsgTimestamp / 1000) : 0
|
||||
property int gapNowAndJoined: Date.now() / 1000 - +chatsModel.channelView.activeChannel.joined / 1000
|
||||
|
||||
visible: {
|
||||
return gapNowAndOldest < Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours
|
||||
&& gapNowAndJoined > Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours
|
||||
&& (chatsModel.activeChannel.chatType !== Constants.chatTypePrivateGroupChat || chatsModel.activeChannel.isMember)
|
||||
}
|
||||
height: childrenRect.height + Style.current.smallPadding * 2
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
Separator {
|
||||
id: sep1
|
||||
}
|
||||
|
||||
Loader {
|
||||
Loader {
|
||||
id: fetchLoaderIndicator
|
||||
anchors.top: sep1.bottom
|
||||
anchors.topMargin: Style.current.padding
|
||||
|
@ -301,8 +308,7 @@ Item {
|
|||
width: 12
|
||||
height: 12
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
StyledText {
|
||||
id: fetchMoreButton
|
||||
font.weight: Font.Medium
|
||||
|
|
Loading…
Reference in New Issue