mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-28 18:45:51 -05:00
Rename buffer lastReadReceipt to prevReadReceipt
This field is intentionally behind the latest read receipt. Let's rename it to make that clearer.
This commit is contained in:
parent
6e59a77672
commit
8a5e52ed9a
3 changed files with 4 additions and 4 deletions
|
@ -305,11 +305,11 @@ export default class App extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
let lastReadReceipt = this.getReceipt(buf.name, ReceiptType.READ);
|
||||
let prevReadReceipt = this.getReceipt(buf.name, ReceiptType.READ);
|
||||
// TODO: only mark as read if user scrolled at the bottom
|
||||
this.setBufferState(buf.id, {
|
||||
unread: Unread.NONE,
|
||||
lastReadReceipt,
|
||||
prevReadReceipt,
|
||||
});
|
||||
|
||||
if (this.buffer.current) {
|
||||
|
|
|
@ -479,7 +479,7 @@ export default class Buffer extends Component {
|
|||
buf.messages.forEach((msg) => {
|
||||
let sep = [];
|
||||
|
||||
if (!hasUnreadSeparator && buf.type != BufferType.SERVER && buf.lastReadReceipt && msg.tags.time > buf.lastReadReceipt.time) {
|
||||
if (!hasUnreadSeparator && buf.type != BufferType.SERVER && buf.prevReadReceipt && msg.tags.time > buf.prevReadReceipt.time) {
|
||||
sep.push(html`<${UnreadSeparator} key="unread"/>`);
|
||||
hasUnreadSeparator = true;
|
||||
}
|
||||
|
|
2
state.js
2
state.js
|
@ -275,7 +275,7 @@ export const State = {
|
|||
offline: false, // if nick
|
||||
messages: [],
|
||||
unread: Unread.NONE,
|
||||
lastReadReceipt: null,
|
||||
prevReadReceipt: null,
|
||||
});
|
||||
bufferList = bufferList.sort(compareBuffers);
|
||||
let buffers = new Map(bufferList.map((buf) => [buf.id, buf]));
|
||||
|
|
Loading…
Reference in a new issue