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.} =
|
proc muted*(self: ChatItemView): bool {.slot.} =
|
||||||
return ?.self.chatItem.muted
|
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:
|
QtProperty[bool] muted:
|
||||||
read = muted
|
read = muted
|
||||||
notify = mutedChanged
|
notify = mutedChanged
|
||||||
|
|
|
@ -283,13 +283,20 @@ Item {
|
||||||
id: fetchMoreMessagesButtonComponent
|
id: fetchMoreMessagesButtonComponent
|
||||||
Item {
|
Item {
|
||||||
id: wrapper
|
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
|
height: childrenRect.height + Style.current.smallPadding * 2
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Separator {
|
Separator {
|
||||||
id: sep1
|
id: sep1
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: fetchLoaderIndicator
|
id: fetchLoaderIndicator
|
||||||
anchors.top: sep1.bottom
|
anchors.top: sep1.bottom
|
||||||
|
@ -302,7 +309,6 @@ Item {
|
||||||
height: 12
|
height: 12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: fetchMoreButton
|
id: fetchMoreButton
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
|
|
Loading…
Reference in New Issue