Fix React Developer Tools for some users (#2783)
* Fix react dev tools test * Fix test
This commit is contained in:
@@ -79,7 +79,7 @@ jest.mock('main/i18nManager', () => ({
|
||||
setLocale: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.mock('electron-devtools-installer', () => {
|
||||
jest.mock('electron-extension-installer', () => {
|
||||
return () => ({
|
||||
REACT_DEVELOPER_TOOLS: 'react-developer-tools',
|
||||
});
|
||||
|
@@ -4,7 +4,7 @@
|
||||
import path from 'path';
|
||||
|
||||
import {app, ipcMain, nativeTheme, session} from 'electron';
|
||||
import installExtension, {REACT_DEVELOPER_TOOLS} from 'electron-devtools-installer';
|
||||
import installExtension, {REACT_DEVELOPER_TOOLS} from 'electron-extension-installer';
|
||||
import isDev from 'electron-is-dev';
|
||||
|
||||
import {
|
||||
@@ -335,7 +335,11 @@ async function initializeAfterAppReady() {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
if (global.isDev || __IS_NIGHTLY_BUILD__) {
|
||||
installExtension(REACT_DEVELOPER_TOOLS).
|
||||
installExtension(REACT_DEVELOPER_TOOLS, {
|
||||
loadExtensionOptions: {
|
||||
allowFileAccess: true,
|
||||
},
|
||||
}).
|
||||
then((name) => log.info(`Added Extension: ${name}`)).
|
||||
catch((err) => log.error('An error occurred: ', err));
|
||||
}
|
||||
|
Reference in New Issue
Block a user