Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
frontend: add react devtools package
Browse files Browse the repository at this point in the history
  • Loading branch information
horacioh committed Sep 1, 2023
1 parent 742d551 commit 725ac45
Show file tree
Hide file tree
Showing 4 changed files with 423 additions and 36 deletions.
2 changes: 2 additions & 0 deletions frontend/apps/desktop/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<head>
<meta charset="UTF-8" />
<title>Mintter App</title>
<!-- REACT DEVTOOLS -->
<script src="http://localhost:8097"></script>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 2 additions & 0 deletions frontend/apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"main": ".vite/build/main.js",
"scripts": {
"dev": "electron-forge start",
"devtools": "react-devtools",
"test": "node test/pre-test.js && yarn e2e && node test/post-test.js",
"e2e": "xvfb-maybe -- playwright test",
"format": "prettier \"**/*.{ts,tsx,md,mdx,json}\" --check --ignore-path ../../../.prettierignore",
Expand Down Expand Up @@ -68,6 +69,7 @@
"electron-packager-languages": "^0.5.0",
"electron-playwright-helpers": "1.6.0",
"eslint-config-custom": "workspace:*",
"react-devtools": "^4.28.0",
"vite-tsconfig-paths": "4.2.0",
"xvfb-maybe": "^0.2.1"
}
Expand Down
29 changes: 5 additions & 24 deletions frontend/apps/desktop/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import {app, BrowserWindow, session, ipcMain, nativeTheme, Menu} from 'electron'
import path from 'path'
import * as Sentry from '@sentry/electron/main'
import os from 'os'
import {BrowserWindow, Menu, app, ipcMain, nativeTheme} from 'electron'
import log from 'electron-log/main'
import updater from 'update-electron-app'
import {mainMenu, openInitialWindows, trpc} from './api'
import {mainDaemon} from './daemon'
import {saveCidAsFile} from './save-cid-as-file'
import updater from 'update-electron-app'
import log from 'electron-log/main'

mainDaemon

Menu.setApplicationMenu(mainMenu)

// check for updates Powered by the free and open-source update.electronjs.org service.
// check for updates Powered by the free and open-source
updater({
updateInterval: '1 hour',
repo: 'mintterteam/mintter',
Expand Down Expand Up @@ -46,25 +44,8 @@ if (import.meta.env.PROD) {
// beforeSend: (request) => (isOnline() ? 'send' : 'queue'),
},
})
} else {
// on macOS
if (os.platform() == 'darwin') {
const reactDevToolsPath = path.join(
os.homedir(),
'/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoieni',
)

app.whenReady().then(async () => {
try {
await session.defaultSession.loadExtension(reactDevToolsPath)
} catch (error) {
console.error(
'[REACT-DEVTOOLS]: error. no react devtools extension found',
)
}
})
}
}

app.on('did-become-active', () => {
console.log('App active')
})
Expand Down
Loading

0 comments on commit 725ac45

Please sign in to comment.