Trigger mark-as-read (almost) immediately after opening chat

This commit is contained in:
Sebastian Wolf 2021-02-16 21:48:14 +01:00
parent 063d782001
commit a432e91996
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A

View file

@ -575,6 +575,7 @@ Page {
}
chatViewCooldownTimer.restart();
chatViewStartupReadTimer.restart();
}
onNewMessageReceived: {
if (chatView.manuallyScrolledToBottom || message.sender.user_id === chatPage.myUserId) {
@ -604,6 +605,7 @@ Page {
viewMessageTimer.queueViewMessage(chatView.count - 1);
}
chatViewCooldownTimer.restart();
chatViewStartupReadTimer.restart();
}
onNotificationSettingsUpdated: {
chatInformation = chatModel.getChatInformation();
@ -933,7 +935,15 @@ Page {
onTriggered: {
Debug.log("[ChatPage] Cooldown completed...");
chatView.inCooldown = false;
}
}
Timer {
id: chatViewStartupReadTimer
interval: 200
repeat: false
running: false
onTriggered: {
if (!chatPage.isInitialized) {
Debug.log("Page is initialized!");
chatPage.isInitialized = true;