From 351ec163b21d08e14a57cee100e15597ccb38074 Mon Sep 17 00:00:00 2001 From: akshitkrnagpal Date: Thu, 28 Jun 2018 12:41:20 +0530 Subject: [PATCH] Refactor arrow function --- app/features/conference/components/Conference.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/features/conference/components/Conference.js b/app/features/conference/components/Conference.js index 6051936..309df43 100644 --- a/app/features/conference/components/Conference.js +++ b/app/features/conference/components/Conference.js @@ -91,6 +91,7 @@ class Conference extends Component { this._ref = React.createRef(); + this._navigateToHome = this._navigateToHome.bind(this); this._onIframeLoad = this._onIframeLoad.bind(this); } @@ -110,7 +111,7 @@ class Conference extends Component { script.async = true; script.onload = () => this._onScriptLoad(parentNode, room, serverURL); - script.onerror = () => this._navigateToHome(); + script.onerror = this._navigateToHome; script.src = getExternalApiURL(serverURL); this._ref.current.appendChild(script); @@ -175,6 +176,8 @@ class Conference extends Component { } } + _navigateToHome: (*) => void; + /** * Navigates to home screen (Welcome). * @@ -212,7 +215,7 @@ class Conference extends Component { setupAlwaysOnTopRender(this._api); setupWiFiStats(iframe); - this._api.on('readyToClose', () => this._navigateToHome()); + this._api.on('readyToClose', this._navigateToHome); this._api.on('videoConferenceJoined', (conferenceInfo: Object) => this._onVideoConferenceJoined(conferenceInfo));