Adds using power monitor and detecting computer suspend. (#174)

* Adds using power monitor and detecting computer suspend.

* Simplify api listener functions.

* Fixes comments.
fix-builder
Дамян Минков 3 years ago committed by GitHub
parent d8bef4a784
commit 26053fc478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      app/features/conference/components/Conference.js
  2. 4
      main.js

@ -12,7 +12,8 @@ import {
setupScreenSharingForWindow,
setupAlwaysOnTopRender,
initPopupsConfigurationRender,
setupWiFiStats
setupWiFiStats,
setupPowerMonitorRender
} from 'jitsi-meet-electron-utils';
import config from '../../config';
@ -112,6 +113,7 @@ class Conference extends Component<Props, State> {
this._ref = React.createRef();
this._onIframeLoad = this._onIframeLoad.bind(this);
this._onVideoConferenceEnded = this._onVideoConferenceEnded.bind(this);
}
/**
@ -265,11 +267,10 @@ class Conference extends Component<Props, State> {
new RemoteControl(iframe); // eslint-disable-line no-new
setupAlwaysOnTopRender(this._api);
setupWiFiStats(iframe);
setupPowerMonitorRender(this._api);
this._api.on('readyToClose', (event: Event) => {
this.props.dispatch(conferenceEnded(this._conference));
this._navigateToHome(event);
});
this._api.on('suspendDetected', this._onVideoConferenceEnded);
this._api.on('readyToClose', this._onVideoConferenceEnded);
this._api.on('videoConferenceJoined',
(conferenceInfo: Object) => {
this.props.dispatch(conferenceJoined(this._conference));
@ -278,6 +279,20 @@ class Conference extends Component<Props, State> {
);
}
_onVideoConferenceEnded: (*) => void;
/**
* Dispatches conference ended and navigates to home screen.
*
* @param {Event} event - Event by which the function is called.
* @returns {void}
* @private
*/
_onVideoConferenceEnded(event: Event) {
this.props.dispatch(conferenceEnded(this._conference));
this._navigateToHome(event);
}
/**
* Updates redux state's user name from conference.
*

@ -12,7 +12,8 @@ const windowStateKeeper = require('electron-window-state');
const {
initPopupsConfigurationMain,
getPopupTarget,
setupAlwaysOnTopMain
setupAlwaysOnTopMain,
setupPowerMonitorMain
} = require('jitsi-meet-electron-utils');
const path = require('path');
const URL = require('url');
@ -143,6 +144,7 @@ function createJitsiMeetWindow() {
initPopupsConfigurationMain(mainWindow);
setupAlwaysOnTopMain(mainWindow);
setupPowerMonitorMain(mainWindow);
mainWindow.webContents.on('new-window', (event, url, frameName) => {
const target = getPopupTarget(url, frameName);

Loading…
Cancel
Save