Fix marking messages as read when the window is thin
Make sure that messages are not marked as read when going back to the roomlist after entering a room when neochat is thin and only showing a single page Fixes #642
This commit is contained in:
@@ -120,6 +120,7 @@ Kirigami.Page {
|
|||||||
sourceComponent: TimelineView {
|
sourceComponent: TimelineView {
|
||||||
id: timelineView
|
id: timelineView
|
||||||
currentRoom: root.currentRoom
|
currentRoom: root.currentRoom
|
||||||
|
page: root
|
||||||
timelineModel: root.timelineModel
|
timelineModel: root.timelineModel
|
||||||
messageFilterModel: root.messageFilterModel
|
messageFilterModel: root.messageFilterModel
|
||||||
actionsHandler: root.actionsHandler
|
actionsHandler: root.actionsHandler
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ QQC2.ScrollView {
|
|||||||
}
|
}
|
||||||
property bool roomChanging: false
|
property bool roomChanging: false
|
||||||
|
|
||||||
|
required property Item page
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The TimelineModel to use.
|
* @brief The TimelineModel to use.
|
||||||
*
|
*
|
||||||
@@ -299,14 +301,14 @@ QQC2.ScrollView {
|
|||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: markReadIfVisibleTimer
|
id: markReadIfVisibleTimer
|
||||||
running: messageListView.allUnreadVisible() && applicationWindow().active && (root.currentRoom.timelineSize > 0 || root.currentRoom.allHistoryLoaded)
|
running: messageListView.allUnreadVisible() && applicationWindow().active && (root.currentRoom.timelineSize > 0 || root.currentRoom.allHistoryLoaded) && applicationWindow().pageStack.visibleItems.includes(root.page)
|
||||||
interval: 10000
|
interval: 10000
|
||||||
onTriggered: root.currentRoom.markAllMessagesAsRead()
|
onTriggered: root.currentRoom.markAllMessagesAsRead()
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
restart();
|
restart();
|
||||||
running = Qt.binding(function () {
|
running = Qt.binding(function () {
|
||||||
return messageListView.allUnreadVisible() && applicationWindow().active && (root.currentRoom.timelineSize > 0 || root.currentRoom.allHistoryLoaded);
|
return messageListView.allUnreadVisible() && applicationWindow().active && (root.currentRoom.timelineSize > 0 || root.currentRoom.allHistoryLoaded) && applicationWindow().pageStack.visibleItems.includes(root.page);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user