install react dev tools in development (#4979)
This commit is contained in:
@@ -52,6 +52,7 @@ import { Recipe } from './recipe';
|
||||
import './utils/recipeHash';
|
||||
import { decodeRecipe } from './api';
|
||||
import { Client, createClient, createConfig } from './api/client';
|
||||
import installExtension, { REACT_DEVELOPER_TOOLS } from 'electron-devtools-installer';
|
||||
|
||||
async function decodeRecipeMain(client: Client, deeplink: string): Promise<Recipe | null> {
|
||||
try {
|
||||
@@ -589,6 +590,15 @@ const createChat = async (
|
||||
},
|
||||
});
|
||||
|
||||
if (!app.isPackaged) {
|
||||
installExtension(REACT_DEVELOPER_TOOLS, {
|
||||
loadExtensionOptions: { allowFileAccess: true },
|
||||
session: mainWindow.webContents.session,
|
||||
})
|
||||
.then(() => log.info('added react dev tools'))
|
||||
.catch((err) => log.info('failed to install react dev tools:', err));
|
||||
}
|
||||
|
||||
const goosedClient = createClient(
|
||||
createConfig({
|
||||
baseUrl: `http://127.0.0.1:${port}`,
|
||||
|
||||
Reference in New Issue
Block a user