From 775245d91e1d7aeeaafeacf0af7710614c6fd632 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Fri, 1 Oct 2021 22:31:53 +0200 Subject: [PATCH] Scroll to read marker: pull more history when read marker is not loaded This is yet another workaround for what should be fixed in #799. --- client/qml/Timeline.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/qml/Timeline.qml b/client/qml/Timeline.qml index 0548c510..4cce2a3c 100644 --- a/client/qml/Timeline.qml +++ b/client/qml/Timeline.qml @@ -816,7 +816,12 @@ Page { source: "qrc:///scrollup.svg" } - onClicked: chatView.scrollViewTo(messageModel.readMarkerVisualIndex, - ListView.Center, true) + onClicked: { + if (messageModel.readMarkerVisualIndex < chatView.count) + chatView.scrollViewTo(messageModel.readMarkerVisualIndex, + ListView.Center, true) + else + room.getPreviousContent(chatView.count / 2) // FIXME, #799 + } } }