electron_bridge: Use getter and setter interface to mutable properties.

This exists in all versions of the desktop app that we still support,
and will eventually let us delete a bit of annoying compatibility code
from the desktop app’s injected JavaScript.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-04-26 14:13:25 -07:00
committed by Tim Abbott
parent 25c5856988
commit e701f20861
3 changed files with 8 additions and 6 deletions

View File

@@ -272,11 +272,11 @@ exports.compute_active_status = function () {
// * For the electron desktop app, we also know whether the
// user is active or idle elsewhere on their system.
//
// The check for `idle_on_system === undefined` is feature
// The check for `get_idle_on_system === undefined` is feature
// detection; older desktop app releases never set that property.
if (window.electron_bridge !== undefined
&& window.electron_bridge.idle_on_system !== undefined) {
if (window.electron_bridge.idle_on_system) {
&& window.electron_bridge.get_idle_on_system !== undefined) {
if (window.electron_bridge.get_idle_on_system()) {
return exports.IDLE;
}
return exports.ACTIVE;