mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 05:52:41 +00:00
fix: add timeout to scroll bottom at all times to make sure we do scroll
This commit is contained in:
parent
78a3ec646c
commit
08f8035b31
@ -99,22 +99,20 @@ ScrollView {
|
||||
// User has scrolled up, we don't want to scroll back
|
||||
return false
|
||||
}
|
||||
if (caller) {
|
||||
if (caller !== chatLogView.itemAtIndex(chatLogView.count - 1)) {
|
||||
if (caller && caller !== chatLogView.itemAtIndex(chatLogView.count - 1)) {
|
||||
// If we have a caller, only accept its request if it's the last message
|
||||
return false
|
||||
}
|
||||
// Call this twice and with a timer since the first scroll to bottom might have happened before some stuff loads
|
||||
// meaning that the scroll will not actually be at the bottom on switch
|
||||
// Add a small delay because images, even though they say they say they are loaed, they aren't shown yet
|
||||
Qt.callLater(chatLogView.positionViewAtEnd)
|
||||
timer.setTimeout(function() {
|
||||
Qt.callLater(chatLogView.positionViewAtEnd)
|
||||
}, 100);
|
||||
return true
|
||||
}
|
||||
|
||||
Qt.callLater(chatLogView.positionViewAtEnd)
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Connections {
|
||||
|
||||
@ -138,10 +136,7 @@ ScrollView {
|
||||
}
|
||||
|
||||
onAppReady: {
|
||||
// Add an additionnal delay, since the app can be "ready" just milliseconds before the UI updated to show the chat
|
||||
timer.setTimeout(function() {
|
||||
chatLogView.scrollToBottom(true)
|
||||
}, 500);
|
||||
}
|
||||
|
||||
onMessageNotificationPushed: function(chatId, msg, messageType, chatType, timestamp, identicon, username, hasMention) {
|
||||
|
@ -11,6 +11,10 @@ Loader {
|
||||
sourceComponent: Component {
|
||||
Shared.ImageLoader {
|
||||
color: root.color
|
||||
onLoaded: {
|
||||
scrollToBottom(true, messageItem)
|
||||
}
|
||||
|
||||
width: 140
|
||||
height: this.visible ? 140 : 0
|
||||
source: this.visible ? ("https://ipfs.infura.io/ipfs/" + sticker) : ""
|
||||
|
@ -6,6 +6,7 @@ Rectangle {
|
||||
id: root
|
||||
property alias source: image.source
|
||||
property alias fillMode: image.fillMode
|
||||
signal loaded
|
||||
signal clicked
|
||||
color: Style.current.backgroundHover
|
||||
state: "loading"
|
||||
@ -131,6 +132,11 @@ Rectangle {
|
||||
horizontalAlignment: Image.AlignHCenter
|
||||
verticalAlignment: Image.AlignVCenter
|
||||
cache: true
|
||||
onStatusChanged: {
|
||||
if (image.status === Image.Ready) {
|
||||
loaded()
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: parent
|
||||
|
Loading…
x
Reference in New Issue
Block a user