mirror of
https://codeberg.org/emersion/gamja
synced 2025-03-13 07:48:37 +01:00
Don't mark messages as read when window is not in focus
This commit is contained in:
parent
f79b6bfaa1
commit
9924f08794
@ -734,7 +734,7 @@ export default class App extends Component {
|
|||||||
let prevReadReceipt = buf.prevReadReceipt;
|
let prevReadReceipt = buf.prevReadReceipt;
|
||||||
let receipts = { [ReceiptType.DELIVERED]: receiptFromMessage(msg) };
|
let receipts = { [ReceiptType.DELIVERED]: receiptFromMessage(msg) };
|
||||||
|
|
||||||
if (this.state.activeBuffer !== buf.id) {
|
if (this.state.activeBuffer !== buf.id || !document.hasFocus()) {
|
||||||
unread = Unread.union(unread, msgUnread);
|
unread = Unread.union(unread, msgUnread);
|
||||||
} else {
|
} else {
|
||||||
receipts[ReceiptType.READ] = receiptFromMessage(msg);
|
receipts[ReceiptType.READ] = receiptFromMessage(msg);
|
||||||
@ -1943,6 +1943,11 @@ export default class App extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleWindowFocus() {
|
handleWindowFocus() {
|
||||||
|
if (this.state.activeBuffer) {
|
||||||
|
// TODO: only do this if scrolled at the bottom
|
||||||
|
this.markBufferAsRead(this.state.activeBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
// When the user focuses gamja, send a PING to make sure we detect any
|
// When the user focuses gamja, send a PING to make sure we detect any
|
||||||
// network errors ASAP
|
// network errors ASAP
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user