fix(@desktop/chat): revert the visible logic for fetch more messages
This is causing fetch more message to not be visible in other chat type such as publich chat
This commit is contained in:
parent
a99eccee00
commit
a2db1deeda
|
@ -182,13 +182,6 @@ 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
|
||||||
|
|
|
@ -311,8 +311,6 @@ Item {
|
||||||
}
|
}
|
||||||
messageContextMenu: svRoot.messageContextMenuInst
|
messageContextMenu: svRoot.messageContextMenuInst
|
||||||
|
|
||||||
// This is used in order to have access to the previous message and determine the timestamp
|
|
||||||
// we can't rely on the index because the sequence of messages is not ordered on the nim side
|
|
||||||
prevMessageIndex: {
|
prevMessageIndex: {
|
||||||
// This is used in order to have access to the previous message and determine the timestamp
|
// This is used in order to have access to the previous message and determine the timestamp
|
||||||
// we can't rely on the index because the sequence of messages is not ordered on the nim side
|
// we can't rely on the index because the sequence of messages is not ordered on the nim side
|
||||||
|
|
|
@ -297,19 +297,6 @@ Item {
|
||||||
id: fetchMoreMessagesButtonComponent
|
id: fetchMoreMessagesButtonComponent
|
||||||
Item {
|
Item {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
readonly property int gapNowAndOldest: nextMessageIndex > -1 ? (Date.now() / 1000 - nextMsgTimestamp / 1000) : 0
|
|
||||||
readonly property int gapNowAndJoined: Date.now() / 1000 - +chatsModel.channelView.activeChannel.joined / 1000
|
|
||||||
readonly property int maxGapInSeconds: Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours
|
|
||||||
|
|
||||||
visible: {
|
|
||||||
if (!chatsModel.channelView.activeChannel) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return gapNowAndOldest < maxGapInSeconds
|
|
||||||
&& gapNowAndJoined > maxGapInSeconds
|
|
||||||
&& (chatsModel.channelView.activeChannel.chatType !== Constants.chatTypePrivateGroupChat
|
|
||||||
|| chatsModel.channelView.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
|
||||||
|
|
Loading…
Reference in New Issue