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:
Steve Howell
2017-03-06 06:42:58 -08:00
committed by Tim Abbott
parent 7cec88c748
commit 89d362656a

View File

@@ -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;
}