Commit cd84feef authored by JC Brand's avatar JC Brand

connection: Re-add `debouncedReconnect`

parent 6fbb9463
...@@ -4,7 +4,7 @@ import u from '@converse/headless/utils/core'; ...@@ -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; ...@@ -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()}`;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment