forked from CringeStudios/gamja
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
@ -539,7 +539,13 @@ export default class App extends Component {
|
|||||||
if (!buf) {
|
if (!buf) {
|
||||||
return;
|
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) {
|
if (!buf) {
|
||||||
return;
|
return;
|
||||||
@ -572,14 +578,7 @@ export default class App extends Component {
|
|||||||
if (!buf) {
|
if (!buf) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
return State.updateBuffer(state, buf.id, { unread: Unread.NONE });
|
||||||
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,
|
|
||||||
});
|
|
||||||
}, () => {
|
}, () => {
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user