New Idle timer; messages not marked read if user is idle
This commit is contained in:
parent
b77246a7e0
commit
8ccb89310b
11 changed files with 55 additions and 55 deletions
|
@ -166,7 +166,7 @@
|
|||
if (!$.contains(this.el, this.inboxView.el)) {
|
||||
this.openView(this.inboxView);
|
||||
}
|
||||
window.focus(); // FIXME
|
||||
|
||||
return Promise.resolve();
|
||||
},
|
||||
onEmpty() {
|
||||
|
|
|
@ -442,7 +442,7 @@
|
|||
id,
|
||||
models.map(model => model.getReduxData()),
|
||||
isNewMessage,
|
||||
document.hasFocus()
|
||||
window.isActive()
|
||||
);
|
||||
} catch (error) {
|
||||
setMessagesLoading(conversationId, true);
|
||||
|
@ -493,7 +493,7 @@
|
|||
id,
|
||||
models.map(model => model.getReduxData()),
|
||||
isNewMessage,
|
||||
document.hasFocus()
|
||||
window.isActive()
|
||||
);
|
||||
} catch (error) {
|
||||
setMessagesLoading(conversationId, false);
|
||||
|
@ -502,10 +502,8 @@
|
|||
finish();
|
||||
}
|
||||
};
|
||||
const markMessageRead = async (messageId, forceFocus) => {
|
||||
// We need a forceFocus parameter because the BrowserWindow focus event fires
|
||||
// before the document realizes that it has focus.
|
||||
if (!document.hasFocus() && !forceFocus) {
|
||||
const markMessageRead = async messageId => {
|
||||
if (!window.isActive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue