pixl-xyapp 2.1.32 → 2.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/base.js +5 -3
- package/package.json +1 -1
package/js/base.js
CHANGED
|
@@ -304,8 +304,10 @@ var app = {
|
|
|
304
304
|
opts.headers['X-CSRF-Token'] = app.csrf_token;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
// default 10 sec timeout
|
|
308
|
-
var
|
|
307
|
+
// default 10 sec timeout if not configured
|
|
308
|
+
var default_timeout = 10000;
|
|
309
|
+
if (window.config && window.config.api_timeout_ms) default_timeout = window.config.api_timeout_ms;
|
|
310
|
+
var timeout = opts.timeout || default_timeout;
|
|
309
311
|
delete opts.timeout;
|
|
310
312
|
|
|
311
313
|
// retry delay (w/exp backoff)
|
|
@@ -320,7 +322,7 @@ var app = {
|
|
|
320
322
|
Debug.trace('api', "HTTP Error: " + err);
|
|
321
323
|
|
|
322
324
|
if (errorCallback) errorCallback({ code: 'http', description: '' + (err.message || err) });
|
|
323
|
-
else app.doError( "HTTP Error: " + err.message || err );
|
|
325
|
+
else app.doError( "HTTP Error: " + err.message || err, 8 ); // hide timeout messages after 8s
|
|
324
326
|
}, timeout );
|
|
325
327
|
|
|
326
328
|
window.fetch( url, opts )
|
package/package.json
CHANGED