Skip to content

Commit

Permalink
update to latest electron
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelvg committed Oct 8, 2021
1 parent 9fb9ac8 commit 9b8e28d
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 72 deletions.
1 change: 1 addition & 0 deletions api/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function createWindow(): void {
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true,
contextIsolation: false,
},
});

Expand Down
6 changes: 1 addition & 5 deletions app/App/Containers/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import { HashRouter } from 'react-router-dom';
import { ThemeProvider } from 'styled-components';
import styled from 'styled-components';

import { IpcRenderer } from 'electron';

const { ipcRenderer }: { ipcRenderer: IpcRenderer } = window.require(
'electron',
);
const { ipcRenderer } = window.require('electron');

import Routes from '../../App/Components/Routes';
import { themes } from '../../Themes';
Expand Down
11 changes: 1 addition & 10 deletions app/Channel/Forms/ChannelForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@ import styled, { withTheme } from 'styled-components';
import { Field } from 'react-final-form';
import Icon from 'react-icons-kit';
import { plus } from 'react-icons-kit/fa/plus';
import { template } from '../../Channel/constants';

const { remote } = window.require('electron');
const { Menu } = remote;

const openMenu = () => {
const macMenu = Menu.buildFromTemplate(template);

macMenu.popup(remote.getCurrentWindow());
};
import { openMenu } from '../constants';

@withTheme
export default class ChannelForm extends Component<any> {
Expand Down
33 changes: 1 addition & 32 deletions app/Channel/Forms/EditForm.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
import React, { Component } from 'react';
import styled, { withTheme } from 'styled-components';

const { remote } = window.require('electron');
const { Menu } = remote;

const template = [
{
label: 'Cut',
accelerator: 'CmdOrCtrl+X',
role: 'cut',
},
{
label: 'Copy',
accelerator: 'CmdOrCtrl+C',
role: 'copy',
},
{
label: 'Paste',
accelerator: 'CmdOrCtrl+V',
role: 'paste',
},
{
label: 'Select All',
accelerator: 'CmdOrCtrl+A',
role: 'selectall',
},
];

const openMenu = () => {
const macMenu = Menu.buildFromTemplate(template);

macMenu.popup(remote.getCurrentWindow());
};
import { openMenu } from '../constants';

@withTheme
export default class EditForm extends Component<any, any> {
Expand Down
11 changes: 1 addition & 10 deletions app/Channel/Forms/SearchForm/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,8 @@ import styled, { withTheme } from 'styled-components';
import { Field } from 'react-final-form';
import Icon from 'react-icons-kit';
import { search } from 'react-icons-kit/fa/search';
import { template } from '../../../Channel/constants';
import AutoSave from './AutoSave';

const { remote } = window.require('electron');
const { Menu } = remote;

export const openMenu = () => {
const macMenu = Menu.buildFromTemplate(template);

macMenu.popup(remote.getCurrentWindow());
};
import { openMenu } from '../../constants';

@withTheme
class SearchForm extends Component<any> {
Expand Down
11 changes: 10 additions & 1 deletion app/Channel/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const { remote } = window.require('electron');
const { Menu } = remote;

export const getTab = (tab) => {
return TABS.find((t) => t.value === tab);
};
Expand All @@ -20,7 +23,7 @@ export const TABS = [
},
];

export const template = [
export const template: any = [
{
label: 'Cut',
accelerator: 'CmdOrCtrl+X',
Expand All @@ -42,3 +45,9 @@ export const template = [
role: 'selectall',
},
];

export const openMenu = () => {
const macMenu = Menu.buildFromTemplate(template);

macMenu.popup({ window: remote.getCurrentWindow() });
};
2 changes: 1 addition & 1 deletion app/Settings/Forms/SettingsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Field } from 'react-final-form';
import Toggle from 'react-toggle-button';
import styled from 'styled-components';
import Select from 'react-select';
import { openMenu } from '../../Channel/Forms/SearchForm/SearchForm';
import { openMenu } from '../../Channel/constants';

const { shell, ipcRenderer } = window.require('electron');

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "KolpaqueClientElectron",
"version": "0.5.6",
"version": "0.5.7",
"description": "Multiplatform GUI for Streamlink",
"main": "./dist-api/main.js",
"scripts": {
Expand Down Expand Up @@ -33,7 +33,7 @@
"archiver": "^4.0.1",
"concurrently": "^5.3.0",
"cross-env": "^5.0.5",
"electron": "^11.0.3",
"electron": "^12.0.0",
"electron-packager": "^14.2.1",
"eslint": "^7.13.0",
"husky": "^1.3.1",
Expand Down
38 changes: 27 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,23 @@
lodash "^4.17.19"
to-fast-properties "^2.0.0"

"@electron/get@^1.0.1", "@electron/get@^1.6.0":
"@electron/get@^1.0.1":
version "1.13.0"
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.13.0.tgz#95c6bcaff4f9a505ea46792424f451efea89228c"
integrity sha512-+SjZhRuRo+STTO1Fdhzqnv9D2ZhjxXP6egsJ9kiO8dtP68cDx7dFCwWi64dlMQV7sWcfW1OYCW4wviEBzmRsfQ==
dependencies:
debug "^4.1.1"
env-paths "^2.2.0"
fs-extra "^8.1.0"
got "^9.6.0"
progress "^2.0.3"
semver "^6.2.0"
sumchecker "^3.0.1"
optionalDependencies:
global-agent "^2.0.2"
global-tunnel-ng "^2.7.1"

"@electron/get@^1.6.0":
version "1.10.0"
resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.10.0.tgz#258fdda22bbd5a247e0b663ba9c525dedc1bdfff"
integrity sha512-hlueNXU51c3CwQjBw/i5fwt+VfQgSQVUTdicpCHkhEjNZaa4CXJ5W1GaxSwtLE2dvRmAHjpIjUMHTqJ53uojfg==
Expand Down Expand Up @@ -238,10 +254,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.2.tgz#160d82623610db590a64e8ca81784e11117e5a54"
integrity sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==

"@types/node@^12.0.12":
version "12.12.37"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.37.tgz#cb4782d847f801fa58316da5b4801ca3a59ae790"
integrity sha512-4mXKoDptrXAwZErQHrLzpe0FN/0Wmf5JRniSVIdwUrtDf9wnmEV1teCNLBo/TwuXhkK/bVegoEn/wmb+x0AuPg==
"@types/node@^14.6.2":
version "14.17.21"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.21.tgz#6359d8cf73481e312a43886fa50afc70ce5592c6"
integrity sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==

"@types/prop-types@*":
version "15.7.3"
Expand Down Expand Up @@ -2386,13 +2402,13 @@ electron-to-chromium@^1.2.7:
version "1.3.33"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.33.tgz#bf00703d62a7c65238136578c352d6c5c042a545"

electron@^11.0.3:
version "11.0.3"
resolved "https://registry.yarnpkg.com/electron/-/electron-11.0.3.tgz#c29eaacda38ce561890e59906ca5f507c72b3ec4"
integrity sha512-nNfbLi7Q1xfJXOEO2adck5TS6asY4Jxc332E4Te8XfQ9hcaC3GiCdeEqk9FndNCwxhJA5Lr9jfSGRTwWebFa/w==
electron@^12.0.0:
version "12.2.1"
resolved "https://registry.yarnpkg.com/electron/-/electron-12.2.1.tgz#ef138fde11efd01743934c3e0df717cc53ee362b"
integrity sha512-Gp+rO81qoaRDP7PTVtBOvnSgDgGlwUuAEWXxi621uOJMIlYFas9ChXe8pjdL0R0vyUpiHVzp6Vrjx41VZqEpsw==
dependencies:
"@electron/get" "^1.0.1"
"@types/node" "^12.0.12"
"@types/node" "^14.6.2"
extract-zip "^1.0.3"

elliptic@^6.0.0:
Expand Down Expand Up @@ -6575,7 +6591,7 @@ semver@^5.5.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==

semver@^6.0.0, semver@^6.3.0:
semver@^6.0.0, semver@^6.2.0, semver@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
Expand Down

0 comments on commit 9b8e28d

Please sign in to comment.