From 55cb0734e2da9e3aa44e3b68927c3448a0e41fcf Mon Sep 17 00:00:00 2001 From: ansuz Date: Sat, 22 Jul 2017 10:56:39 +0200 Subject: [PATCH] make bad state timeout configurable --- customize.dist/application_config.js | 1 + www/common/cryptpad-common.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/customize.dist/application_config.js b/customize.dist/application_config.js index a3da8eb3f..0dadf9385 100644 --- a/customize.dist/application_config.js +++ b/customize.dist/application_config.js @@ -49,6 +49,7 @@ define(function() { users. */ config.loginSalt = ''; + config.badStateTimeout = 30000; return config; }); diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 5b7e5a15a..a64c2cf63 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -244,6 +244,8 @@ define([ }; common.infiniteSpinnerDetected = false; + var BAD_STATE_TIMEOUT = typeof(AppConfig.badStateTimeout) === 'number'? + AppConfig.badStateTimeout: 30000; var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) { realtime.sync(); @@ -263,7 +265,7 @@ define([ window.location.reload(); }); common.infiniteSpinnerDetected = true; - }, 30000); + }, BAD_STATE_TIMEOUT) realtime.onSettle(function () { clearTimeout(to); cb();