Load (my) redux dev tools in dev mode
This commit is contained in:
@@ -11,7 +11,7 @@ import { ThemeProvider } from '@material-ui/styles'
|
|||||||
import './utils/tracking'
|
import './utils/tracking'
|
||||||
import { themes } from './theme'
|
import { themes } from './theme'
|
||||||
|
|
||||||
const composeEnhancers = /*(window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || */ compose
|
const composeEnhancers = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
|
||||||
const store = createStore(
|
const store = createStore(
|
||||||
reducers,
|
reducers,
|
||||||
composeEnhancers(
|
composeEnhancers(
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
import * as os from 'os'
|
||||||
|
import * as path from 'path'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import { BrowserWindow } from 'electron'
|
||||||
|
|
||||||
export async function waitForDevServer() {
|
export async function waitForDevServer() {
|
||||||
let response
|
let response
|
||||||
@@ -13,6 +16,13 @@ export async function waitForDevServer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function loadDevTools() {
|
||||||
|
// Redux
|
||||||
|
BrowserWindow.addDevToolsExtension(
|
||||||
|
path.join(os.homedir(), '/Library/Application Support/Google/Chrome/Default/Extensions/lmhkpmbekcpmknklioeibfkpmmfibljd/2.17.0_0/')
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export function isDev() {
|
export function isDev() {
|
||||||
return Boolean(process.argv.find(arg => arg === '--development'))
|
return Boolean(process.argv.find(arg => arg === '--development'))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { ConnectionManager } from '../backend/src/index'
|
|||||||
import { electronTelemetryFactory } from 'electron-telemetry'
|
import { electronTelemetryFactory } from 'electron-telemetry'
|
||||||
import { menuTemplate } from './MenuTemplate'
|
import { menuTemplate } from './MenuTemplate'
|
||||||
import buildOptions from './buildOptions'
|
import buildOptions from './buildOptions'
|
||||||
import { waitForDevServer, isDev, runningUiTestOnCi } from './development'
|
import { waitForDevServer, isDev, runningUiTestOnCi, loadDevTools } from './development'
|
||||||
import { shouldAutoUpdate as shouldAutoUpdate, handleAutoUpdate } from './autoUpdater'
|
import { shouldAutoUpdate as shouldAutoUpdate, handleAutoUpdate } from './autoUpdater'
|
||||||
|
|
||||||
if (!isDev() && !runningUiTestOnCi()) {
|
if (!isDev() && !runningUiTestOnCi()) {
|
||||||
@@ -30,6 +30,7 @@ let mainWindow: BrowserWindow | undefined
|
|||||||
async function createWindow() {
|
async function createWindow() {
|
||||||
if (isDev()) {
|
if (isDev()) {
|
||||||
await waitForDevServer()
|
await waitForDevServer()
|
||||||
|
loadDevTools()
|
||||||
}
|
}
|
||||||
|
|
||||||
const iconPath = path.join(__dirname, 'icon.png')
|
const iconPath = path.join(__dirname, 'icon.png')
|
||||||
|
|||||||
Reference in New Issue
Block a user