typing_status.js: Remove var state.

It would conflict with `exports.state` after migration to an ES6
module.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2018-08-04 02:19:41 -04:00 committed by Tim Abbott
parent 84bc2186eb
commit f9dd7a8b4e
1 changed files with 6 additions and 8 deletions

View File

@ -43,16 +43,14 @@ exports.initialize_state = function () {
exports.initialize_state();
exports.stop_last_notification = function stop_last_notification(worker) {
var state = exports.state;
if (state.idle_timer) {
clearTimeout(state.idle_timer);
if (exports.state.idle_timer) {
clearTimeout(exports.state.idle_timer);
}
worker.notify_server_stop(state.current_recipient);
worker.notify_server_stop(exports.state.current_recipient);
exports.initialize_state();
};
exports.start_or_extend_idle_timer = function start_or_extend_idle_timer(worker) {
var state = exports.state;
function on_idle_timeout() {
// We don't do any real error checking here, because
// if we've been idle, we need to tell folks, and if
@ -61,10 +59,10 @@ exports.start_or_extend_idle_timer = function start_or_extend_idle_timer(worker)
exports.stop_last_notification(worker);
}
if (state.idle_timer) {
clearTimeout(state.idle_timer);
if (exports.state.idle_timer) {
clearTimeout(exports.state.idle_timer);
}
state.idle_timer = setTimeout(
exports.state.idle_timer = setTimeout(
on_idle_timeout,
TYPING_STOPPED_WAIT_PERIOD
);