diff --git a/components/app.js b/components/app.js index 9b650ec..3786d76 100644 --- a/components/app.js +++ b/components/app.js @@ -402,19 +402,20 @@ export default class App extends Component { if (!buf) { return; } - return { activeBuffer: buf.id }; + + let prevReadReceipt = this.getReceipt(buf.name, ReceiptType.READ); + // TODO: only mark as read if user scrolled at the bottom + let update = State.updateBuffer(state, buf.id, { + unread: Unread.NONE, + prevReadReceipt, + }); + + return { ...update, activeBuffer: buf.id }; }, () => { if (!buf) { return; } - 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, - prevReadReceipt, - }); - if (this.buffer.current) { this.buffer.current.focus(); }