From d4f882b4ae2432e6f63f9e17c7bdb8a36b66d144 Mon Sep 17 00:00:00 2001
From: ali asaria <aliasaria@users.noreply.github.com>
Date: Thu, 3 Oct 2024 13:03:48 -0400
Subject: [PATCH] enable react developer tools if development mode is on

---
 src/main/main.ts | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/main/main.ts b/src/main/main.ts
index 10f8b949..b7d62b7e 100644
--- a/src/main/main.ts
+++ b/src/main/main.ts
@@ -30,6 +30,10 @@ import {
   getLogFilePath,
 } from './util';
 
+import installExtension, {
+  REACT_DEVELOPER_TOOLS,
+} from 'electron-devtools-installer';
+
 const fs = require('fs');
 const Tail = require('tail').Tail;
 
@@ -414,6 +418,13 @@ app
   .then(() => {
     createWindow();
 
+    if (isDebug) {
+      console.log('installing react dev tools');
+      installExtension(REACT_DEVELOPER_TOOLS)
+        .then((name) => console.log(`Added Extension:  ${name}`))
+        .catch((err) => console.log('An error occurred: ', err));
+    }
+
     app.on('activate', () => {
       // On macOS it's common to re-create a window in the app when the
       // dock icon is clicked and there are no other windows open.
-- 
GitLab