Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
csett86 committed May 1, 2022
2 parents fd549f9 + db3a6e2 commit ced1e78
Show file tree
Hide file tree
Showing 12 changed files with 4,038 additions and 11,032 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[ignore]
<PROJECT_ROOT>/node_modules/@atlaskit/.*/*.js.flow
<PROJECT_ROOT>/node_modules/redux-persist/.*/*.js.flow
<PROJECT_ROOT>/node_modules/resolve/test/resolver/malformed_package_json/package.json
<PROJECT_ROOT>/build/.*
<PROJECT_ROOT>/dist/.*

Expand Down
4 changes: 2 additions & 2 deletions app/features/app/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class App extends Component<*> {
*/
_listenOnProtocolMessages(event, inputURL: string) {
// Remove trailing slash if one exists.
if (inputURL.substr(-1) === '/') {
inputURL = inputURL.substr(0, inputURL.length - 1); // eslint-disable-line no-param-reassign
if (inputURL.slice(-1) === '/') {
inputURL = inputURL.slice(0, -1); // eslint-disable-line no-param-reassign
}

const conference = createConferenceObjectFromURL(inputURL);
Expand Down
34 changes: 5 additions & 29 deletions app/features/conference/components/Conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,35 +238,11 @@ class Conference extends Component<Props, State> {
}
);

const { RemoteControl,
setupScreenSharingRender,
setupAlwaysOnTopRender,
initPopupsConfigurationRender,
setupWiFiStats,
setupPowerMonitorRender
} = window.jitsiNodeAPI.jitsiMeetElectronUtils;

initPopupsConfigurationRender(this._api);

const iframe = this._api.getIFrame();

setupScreenSharingRender(this._api);

if (ENABLE_REMOTE_CONTROL) {
new RemoteControl(iframe); // eslint-disable-line no-new
}

// Allow window to be on top if enabled in settings
if (this.props._alwaysOnTopWindowEnabled) {
setupAlwaysOnTopRender(this._api);
}

// Disable WiFiStats on mac due to jitsi-meet-electron#585
if (window.jitsiNodeAPI.platform !== 'darwin') {
setupWiFiStats(iframe);
}

setupPowerMonitorRender(this._api);
// Setup Jitsi Meet Electron SDK on this renderer.
window.jitsiNodeAPI.setupRenderer(this._api, {
enableRemoteControl: ENABLE_REMOTE_CONTROL,
enableAlwaysOnTopWindow: this.props._alwaysOnTopWindowEnabled
});
}

/**
Expand Down
4 changes: 1 addition & 3 deletions app/features/conference/external_api.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions app/features/navbar/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';

import { SettingsButton, SettingsDrawer } from '../../settings';
import { isElectronMac } from '../../utils';

import HelpButton from './HelpButton';
import Logo from './Logo';
Expand Down Expand Up @@ -66,7 +65,6 @@ class Navbar extends Component<Props, *> {
globalPrimaryActions = { this._getPrimaryActions() }
globalPrimaryIcon = { <Logo /> }
globalSecondaryActions = { this._getSecondaryActions() }
isElectronMac = { isElectronMac() }
isOpen = { false }
isResizeable = { false } />
);
Expand Down
11 changes: 0 additions & 11 deletions app/features/utils/functions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
/* global process */

// @flow


/**
* Return true if Electron app is running on Mac system.
*
* @returns {boolean}
*/
export function isElectronMac() {
return process.platform === 'darwin';
}

/**
* Normalizes the given server URL so it has the proper scheme.
*
Expand Down
2 changes: 1 addition & 1 deletion app/features/welcome/components/Welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Welcome extends Component<Props, State> {
*/
_animateRoomnameChanging(word: string) {
let animateTimeoutId;
const roomPlaceholder = this.state.roomPlaceholder + word.substr(0, 1);
const roomPlaceholder = this.state.roomPlaceholder + word.slice(0, 1);

if (word.length > 1) {
animateTimeoutId
Expand Down
46 changes: 40 additions & 6 deletions app/preload/preload.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,50 @@
/* global process */

const { ipcRenderer } = require('electron');
const jitsiMeetElectronUtils = require('@jitsi/electron-sdk');
const { RemoteControl,
setupScreenSharingRender,
setupAlwaysOnTopRender,
initPopupsConfigurationRender,
setupWiFiStats,
setupPowerMonitorRender
} = require('@jitsi/electron-sdk');
const { platform } = require('process');
const { openExternalLink } = require('../features/utils/openExternalLink');


const whitelistedIpcChannels = [ 'protocol-data-msg', 'renderer-ready' ];

/**
* Setup the renderer process.
*
* @param {*} api - API object.
* @param {*} options - Options for what to enable.
* @returns {void}
*/
function setupRenderer(api, options = {}) {
initPopupsConfigurationRender(api);

const iframe = api.getIFrame();

setupScreenSharingRender(api);

if (options.enableRemoteControl) {
new RemoteControl(iframe); // eslint-disable-line no-new
}

// Allow window to be on top if enabled in settings
if (options.enableAlwaysOnTopWindow) {
setupAlwaysOnTopRender(api);
}

// Disable WiFiStats on mac due to jitsi-meet-electron#585
if (platform !== 'darwin') {
setupWiFiStats(iframe);
}

setupPowerMonitorRender(api);
}

window.jitsiNodeAPI = {
openExternalLink,
platform: process.platform,
jitsiMeetElectronUtils,
setupRenderer,
ipc: {
on: (channel, listener) => {
if (!whitelistedIpcChannels.includes(channel)) {
Expand Down
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global __dirname, process */
/* global __dirname */

const {
BrowserWindow,
Expand All @@ -20,6 +20,7 @@ const {
setupScreenSharingMain
} = require('@jitsi/electron-sdk');
const path = require('path');
const process = require('process');
const URL = require('url');
const config = require('./app/features/config');
const { openExternalLink } = require('./app/features/utils/openExternalLink');
Expand Down
Loading

0 comments on commit ced1e78

Please sign in to comment.