summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-12-11 13:15:23 +0100
committerOskar Nyberg <oskar@mullvad.net>2020-12-17 12:51:41 +0100
commit4480a3a230598dfee0dca3d4f692b3c72812c60b (patch)
tree68c93f2beadd9d40af5bc059ee0c04cca96786a0 /gui/src/renderer/components
parent71ef54b0f1559c3e999d8c29c2dc3333db8adeb8 (diff)
downloadmullvadvpn-4480a3a230598dfee0dca3d4f692b3c72812c60b.tar.xz
mullvadvpn-4480a3a230598dfee0dca3d4f692b3c72812c60b.zip
Replace usage of Electron APIs in renderer process with IPC calls
Diffstat (limited to 'gui/src/renderer/components')
-rw-r--r--gui/src/renderer/components/LinuxSplitTunnelingSettings.tsx9
-rw-r--r--gui/src/renderer/components/NotificationArea.tsx5
2 files changed, 8 insertions, 6 deletions
diff --git a/gui/src/renderer/components/LinuxSplitTunnelingSettings.tsx b/gui/src/renderer/components/LinuxSplitTunnelingSettings.tsx
index 9426601532..145fb5a032 100644
--- a/gui/src/renderer/components/LinuxSplitTunnelingSettings.tsx
+++ b/gui/src/renderer/components/LinuxSplitTunnelingSettings.tsx
@@ -1,4 +1,3 @@
-import { remote } from 'electron';
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
import { useHistory } from 'react-router';
import { sprintf } from 'sprintf-js';
@@ -98,7 +97,11 @@ const StyledBrowseButton = styled(AppButton.BlueButton)({
});
export default function LinuxSplitTunnelingSettings() {
- const { getSplitTunnelingApplications, launchExcludedApplication } = useAppContext();
+ const {
+ getSplitTunnelingApplications,
+ launchExcludedApplication,
+ showOpenDialog,
+ } = useAppContext();
const history = useHistory();
const [applications, setApplications] = useState<ISplitTunnelingApplication[]>();
@@ -109,7 +112,7 @@ export default function LinuxSplitTunnelingSettings() {
const launchWithFilePicker = useCallback(async () => {
setBrowsing(true);
- const file = await remote.dialog.showOpenDialog({
+ const file = await showOpenDialog({
properties: ['openFile'],
buttonLabel: messages.pgettext('split-tunneling-view', 'Launch application'),
});
diff --git a/gui/src/renderer/components/NotificationArea.tsx b/gui/src/renderer/components/NotificationArea.tsx
index 012fa89d57..35fcffdd6d 100644
--- a/gui/src/renderer/components/NotificationArea.tsx
+++ b/gui/src/renderer/components/NotificationArea.tsx
@@ -1,4 +1,3 @@
-import { shell } from 'electron';
import log from 'electron-log';
import React, { useCallback } from 'react';
import { useSelector } from 'react-redux';
@@ -96,13 +95,13 @@ interface INotificationActionWrapperProps {
}
function NotificationActionWrapper(props: INotificationActionWrapperProps) {
- const { openLinkWithAuth } = useAppContext();
+ const { openLinkWithAuth, openUrl } = useAppContext();
const handleClick = useCallback(() => {
if (props.action.withAuth) {
return openLinkWithAuth(props.action.url);
} else {
- return shell.openExternal(props.action.url);
+ return openUrl(props.action.url);
}
}, []);