diff options
author | akshitkrnagpal <akshitkrnagpal@gmail.com> | 2018-06-28 12:41:20 +0530 |
---|---|---|
committer | Saúl Ibarra Corretgé <s@saghul.net> | 2018-06-29 08:27:47 +0100 |
commit | 351ec163b21d08e14a57cee100e15597ccb38074 (patch) | |
tree | 5588495f73f1ad9291950eff3946c14bfa90caaa | |
parent | 31d1bb896204ef241ab62e7b4fa4f0faf6ef1f5c (diff) |
Refactor arrow function
-rw-r--r-- | app/features/conference/components/Conference.js | 7 |
1 files 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<Props, State> { this._ref = React.createRef(); + this._navigateToHome = this._navigateToHome.bind(this); this._onIframeLoad = this._onIframeLoad.bind(this); } @@ -110,7 +111,7 @@ class Conference extends Component<Props, State> { 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<Props, State> { } } + _navigateToHome: (*) => void; + /** * Navigates to home screen (Welcome). * @@ -212,7 +215,7 @@ class Conference extends Component<Props, State> { 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)); |