Addressed PR feedback.
This commit is contained in:
parent
7255dcd256
commit
6efe90ef77
|
@ -283,12 +283,13 @@ Item {
|
||||||
id: fetchMoreMessagesButtonComponent
|
id: fetchMoreMessagesButtonComponent
|
||||||
Item {
|
Item {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
property int gapNowAndOldest: nextMessageIndex > -1 ? (Date.now() / 1000 - nextMsgTimestamp / 1000) : 0
|
readonly property int gapNowAndOldest: nextMessageIndex > -1 ? (Date.now() / 1000 - nextMsgTimestamp / 1000) : 0
|
||||||
property int gapNowAndJoined: Date.now() / 1000 - +chatsModel.channelView.activeChannel.joined / 1000
|
readonly property int gapNowAndJoined: Date.now() / 1000 - +chatsModel.channelView.activeChannel.joined / 1000
|
||||||
|
readonly property int maxGapInSeconds: Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours
|
||||||
|
|
||||||
visible: {
|
visible: {
|
||||||
return gapNowAndOldest < Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours
|
return gapNowAndOldest < maxGapInSeconds
|
||||||
&& gapNowAndJoined > Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours
|
&& gapNowAndJoined > maxGapInSeconds
|
||||||
&& (chatsModel.activeChannel.chatType !== Constants.chatTypePrivateGroupChat || chatsModel.activeChannel.isMember)
|
&& (chatsModel.activeChannel.chatType !== Constants.chatTypePrivateGroupChat || chatsModel.activeChannel.isMember)
|
||||||
}
|
}
|
||||||
height: childrenRect.height + Style.current.smallPadding * 2
|
height: childrenRect.height + Style.current.smallPadding * 2
|
||||||
|
|
Loading…
Reference in New Issue