From 6efe90ef77db978412bb66d0fdd5d031f0b89ebb Mon Sep 17 00:00:00 2001 From: Andrei Smirnov Date: Fri, 2 Jul 2021 10:55:03 +0300 Subject: [PATCH] Addressed PR feedback. --- ui/app/AppLayouts/Chat/ChatColumn/Message.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml index fc6ebb9c52..76dbcc4e06 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml @@ -283,12 +283,13 @@ 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 + 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: { - return gapNowAndOldest < Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours - && gapNowAndJoined > Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours + return gapNowAndOldest < maxGapInSeconds + && gapNowAndJoined > maxGapInSeconds && (chatsModel.activeChannel.chatType !== Constants.chatTypePrivateGroupChat || chatsModel.activeChannel.isMember) } height: childrenRect.height + Style.current.smallPadding * 2