Skip to content

Commit a890e8d

Browse files
author
john-do3
committed
- fix: download item/remote module issues
1 parent bfc0c67 commit a890e8d

File tree

2 files changed

+6
-6
lines changed
  • src/renderer/views/downloads-dialog/components

2 files changed

+6
-6
lines changed

src/renderer/views/downloads-dialog/components/DownloadItem/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
SecondaryText,
1313
} from './style';
1414
import { IDownloadItem } from '~/interfaces';
15-
import prettyBytes = require('pretty-bytes');
16-
import { shell } from 'electron';
15+
import prettyBytes from 'pretty-bytes';
16+
const { shell } = require('electron');
1717
import store from '../../store';
1818
import { DownloadItemMenu } from '../DownloadItemMenu';
1919

src/renderer/views/downloads-dialog/components/DownloadItemMenu/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { observer } from 'mobx-react-lite';
33
import { IDownloadItem } from '~/interfaces';
4-
import { clipboard, ipcRenderer, remote, shell } from 'electron';
4+
import { clipboard, ipcRenderer, shell } from 'electron';
55
import {
66
ICON_CHECK,
77
ICON_PAUSE,
@@ -36,7 +36,7 @@ const toggleOpenWhenDone =
3636

3737
const showInFolder =
3838
(item: IDownloadItem) => (e: React.MouseEvent<HTMLDivElement>) => {
39-
remote.shell.showItemInFolder(item.savePath);
39+
require('@electron/remote').shell.showItemInFolder(item.savePath);
4040
store.closeAllDownloadMenu();
4141
e.stopPropagation();
4242
};
@@ -82,8 +82,8 @@ const trashDownload =
8282
console.log('Downloaded item has been deleted successfully.');
8383
})
8484
.catch((err) => {
85-
const window = remote.getCurrentWindow();
86-
const dialog = remote.dialog;
85+
const window = require('@electron/remote').getCurrentWindow();
86+
const dialog = require('@electron/remote').dialog;
8787
dialog.showMessageBox(window, {
8888
title: "Couldn't Delete File",
8989
buttons: ['cancel'],

0 commit comments

Comments
 (0)