mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
Simplify focus_lost() function (and add comments).
The function focus_lost() was setting has_focus to false in all cases; now it does it more clearly. I also added a comment explaining why we don't ping on losing focus.
This commit is contained in:
@@ -215,10 +215,9 @@ function sort_users(user_ids, presence_info) {
|
||||
exports._sort_users = sort_users;
|
||||
|
||||
function focus_lost() {
|
||||
if (!exports.has_focus) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// When we become idle, we don't immediately send anything to the
|
||||
// server; instead, we wait for our next periodic update, since
|
||||
// this data is fundamentally not timely.
|
||||
exports.has_focus = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user