|
@@ -4,7 +4,7 @@ import u from '@converse/headless/utils/core';
|
|
import { Strophe } from 'strophe.js/src/core';
|
|
import { Strophe } from 'strophe.js/src/core';
|
|
import { __ } from './i18n';
|
|
import { __ } from './i18n';
|
|
import { _converse, api, clearSession, tearDown } from "./converse-core";
|
|
import { _converse, api, clearSession, tearDown } from "./converse-core";
|
|
-import { isElement, noop } from 'lodash';
|
|
|
|
|
|
+import { debounce, isElement, noop } from 'lodash';
|
|
|
|
|
|
|
|
|
|
const BOSH_WAIT = 59;
|
|
const BOSH_WAIT = 59;
|
|
@@ -17,6 +17,11 @@ const BOSH_WAIT = 59;
|
|
*/
|
|
*/
|
|
export class Connection extends Strophe.Connection {
|
|
export class Connection extends Strophe.Connection {
|
|
|
|
|
|
|
|
+ constructor (service, options) {
|
|
|
|
+ super(service, options);
|
|
|
|
+ this.debouncedReconnect = debounce(this.reconnect, 2000);
|
|
|
|
+ }
|
|
|
|
+
|
|
static generateResource () {
|
|
static generateResource () {
|
|
return `/converse.js-${Math.floor(Math.random()*139749528).toString()}`;
|
|
return `/converse.js-${Math.floor(Math.random()*139749528).toString()}`;
|
|
}
|
|
}
|