Skip to content

Commit

Permalink
feat(TS) migrate IceFailedHandling to TS (#2663)
Browse files Browse the repository at this point in the history
  • Loading branch information
naman9271 authored Feb 26, 2025
1 parent f5964f9 commit 719b7d6
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getLogger } from '@jitsi/logger';

import * as JitsiConferenceErrors from '../../JitsiConferenceErrors';
import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
import JitsiConference from '../../JitsiConference';

const logger = getLogger(__filename);

Expand All @@ -14,11 +15,15 @@ const logger = getLogger(__filename);
* 'enableForcedReload' option is set in config.js, the conference will be forcefully reloaded.
*/
export default class IceFailedHandling {
private _conference: JitsiConference;
private _canceled: boolean = false;
private _iceFailedTimeout?: number;

/**
* Creates new {@code DelayedIceFailed} task.
* @param {JitsiConference} conference
*/
constructor(conference) {
constructor(conference:JitsiConference) {
this._conference = conference;
}

Expand All @@ -28,7 +33,7 @@ export default class IceFailedHandling {
* @private
* @returns {void}
*/
_actOnIceFailed() {
_actOnIceFailed(): void {
if (!this._conference.room) {
return;
}
Expand Down Expand Up @@ -66,8 +71,9 @@ export default class IceFailedHandling {

/**
* Starts the task.
* @returns {void}
*/
start() {
start(): void {
// Using xmpp.ping allows to handle both XMPP being disconnected and internet offline cases. The ping function
// uses sendIQ2 method which is resilient to XMPP connection disconnected state and will patiently wait until it
// gets reconnected.
Expand All @@ -93,8 +99,9 @@ export default class IceFailedHandling {

/**
* Cancels the task.
* @returns {void}
*/
cancel() {
cancel(): void {
this._canceled = true;
window.clearTimeout(this._iceFailedTimeout);
}
Expand Down

0 comments on commit 719b7d6

Please sign in to comment.