diff --git a/src/qml/RoomPage.qml b/src/qml/RoomPage.qml index fdce1a171..a63662309 100644 --- a/src/qml/RoomPage.qml +++ b/src/qml/RoomPage.qml @@ -198,7 +198,7 @@ Kirigami.Page { Shortcut { sequence: StandardKey.Cancel onActivated: { - if (!timelineViewLoader.item.atYEnd || root.currentRoom.hasUnreadMessages) { + if (!timelineViewLoader.item.atYEnd || !root.currentRoom.partiallyReadStats.empty()) { timelineViewLoader.item.goToLastMessage(); root.currentRoom.markAllMessagesAsRead(); } else { diff --git a/src/qml/TimelineView.qml b/src/qml/TimelineView.qml index f4e32709d..56116ac92 100644 --- a/src/qml/TimelineView.qml +++ b/src/qml/TimelineView.qml @@ -186,7 +186,7 @@ QQC2.ScrollView { padding: Kirigami.Units.largeSpacing z: 2 - visible: (root.currentRoom?.hasUnreadMessages ?? false) + visible: (!root.currentRoom?.partiallyReadStats.empty()) text: root.currentRoom.readMarkerLoaded ? i18n("Jump to first unread message") : i18n("Jump to oldest loaded message") action: Kirigami.Action { @@ -195,7 +195,7 @@ QQC2.ScrollView { root.focusChatBar(); } goReadMarkerFab.textChanged() - messageListView.goToEvent(root.currentRoom.readMarkerEventId); + messageListView.goToEvent(root.currentRoom.lastFullyReadEventId); } icon.name: "go-up" shortcut: "Shift+PgUp" @@ -354,7 +354,7 @@ QQC2.ScrollView { } function allUnreadVisible() { - let readMarkerRow = eventToIndex(root.currentRoom.readMarkerEventId); + let readMarkerRow = eventToIndex(root.currentRoom.lastFullyReadEventId); if (readMarkerRow >= 0 && readMarkerRow < firstVisibleIndex() && messageListView.atYEnd) { return true; }