mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
components/app: stop updating prevReadReceipt on READ message
prevReadReceipt is used for the unread marker. Let's not update it before the user switches the current buffer.
This commit is contained in:
parent
6a9a8e88f1
commit
dc398baa3b
1 changed files with 5 additions and 6 deletions
|
@ -1031,11 +1031,14 @@ export default class App extends Component {
|
|||
break;
|
||||
}
|
||||
let readReceipt = { time: bound.replace("timestamp=", "") };
|
||||
this.bufferStore.put({
|
||||
let updated = this.bufferStore.put({
|
||||
name: target,
|
||||
server: client.params,
|
||||
receipts: { [ReceiptType.READ]: readReceipt },
|
||||
});
|
||||
if (!updated) {
|
||||
break;
|
||||
}
|
||||
for (let notif of this.messageNotifications) {
|
||||
if (client.cm(notif.data.bufferName) !== client.cm(target)) {
|
||||
continue;
|
||||
|
@ -1045,10 +1048,6 @@ export default class App extends Component {
|
|||
}
|
||||
}
|
||||
this.setBufferState({ server: serverID, name: target }, (buf) => {
|
||||
if (buf.prevReadReceipt && buf.prevReadReceipt.time >= readReceipt.time) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Re-compute unread status
|
||||
let unread = Unread.NONE;
|
||||
for (let i = buf.messages.length - 1; i >= 0; i--) {
|
||||
|
@ -1068,7 +1067,7 @@ export default class App extends Component {
|
|||
unread = Unread.MESSAGE;
|
||||
}
|
||||
|
||||
return { prevReadReceipt: readReceipt, unread };
|
||||
return { unread };
|
||||
});
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue