mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
Don't drop unread marker in addMessage
Closes: https://todo.sr.ht/~emersion/gamja/76
This commit is contained in:
parent
b14cddc0d0
commit
6e59a77672
2 changed files with 2 additions and 3 deletions
|
@ -467,19 +467,17 @@ export default class App extends Component {
|
|||
this.setBufferState(bufID, (buf) => {
|
||||
// TODO: set unread if scrolled up
|
||||
let unread = buf.unread;
|
||||
let lastReadReceipt = buf.lastReadReceipt;
|
||||
if (this.state.activeBuffer !== buf.id) {
|
||||
unread = Unread.union(unread, msgUnread);
|
||||
} else {
|
||||
this.setReceipt(bufName, ReceiptType.READ, msg);
|
||||
lastReadReceipt = this.getReceipt(bufName, ReceiptType.READ);
|
||||
}
|
||||
this.bufferStore.put({
|
||||
name: buf.name,
|
||||
server: client.params,
|
||||
unread,
|
||||
});
|
||||
return { unread, lastReadReceipt };
|
||||
return { unread };
|
||||
});
|
||||
}
|
||||
|
||||
|
|
1
state.js
1
state.js
|
@ -275,6 +275,7 @@ export const State = {
|
|||
offline: false, // if nick
|
||||
messages: [],
|
||||
unread: Unread.NONE,
|
||||
lastReadReceipt: null,
|
||||
});
|
||||
bufferList = bufferList.sort(compareBuffers);
|
||||
let buffers = new Map(bufferList.map((buf) => [buf.id, buf]));
|
||||
|
|
Loading…
Reference in a new issue