mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-28 18:26:19 -05:00
components/app: update prevReadReceipt only when switching buffer
We don't want the unread separator to move around when the tab gets focus, for instance.
This commit is contained in:
parent
0b7726819d
commit
3d03c0dbcf
1 changed files with 8 additions and 9 deletions
|
@ -539,7 +539,13 @@ export default class App extends Component {
|
|||
if (!buf) {
|
||||
return;
|
||||
}
|
||||
return { activeBuffer: buf.id };
|
||||
|
||||
let client = this.clients.get(buf.server);
|
||||
let stored = this.bufferStore.get({ name: buf.name, server: client.params });
|
||||
let prevReadReceipt = getReceipt(stored, ReceiptType.READ);
|
||||
let update = State.updateBuffer(state, buf.id, { prevReadReceipt });
|
||||
|
||||
return { activeBuffer: buf.id, ...update };
|
||||
}, () => {
|
||||
if (!buf) {
|
||||
return;
|
||||
|
@ -572,14 +578,7 @@ export default class App extends Component {
|
|||
if (!buf) {
|
||||
return;
|
||||
}
|
||||
|
||||
let client = this.clients.get(buf.server);
|
||||
let stored = this.bufferStore.get({ name: buf.name, server: client.params });
|
||||
let prevReadReceipt = getReceipt(stored, ReceiptType.READ);
|
||||
return State.updateBuffer(state, buf.id, {
|
||||
unread: Unread.NONE,
|
||||
prevReadReceipt,
|
||||
});
|
||||
return State.updateBuffer(state, buf.id, { unread: Unread.NONE });
|
||||
}, () => {
|
||||
if (!buf) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue