Skip to content

Commit

Permalink
Cleanup webview devtools setup (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Nov 5, 2024
1 parent 75a230a commit 8df5776
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
1 change: 0 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const IPC_CHANNELS = {
FIRST_TIME_SETUP_COMPLETE: 'first-time-setup-complete',
DEFAULT_INSTALL_LOCATION: 'default-install-location',
GET_PRELOAD_SCRIPT: 'get-preload-script',
OPEN_DEVTOOLS: 'open-devtools',
OPEN_LOGS_FOLDER: 'open-logs-folder',
DOWNLOAD_PROGRESS: 'download-progress',
START_DOWNLOAD: 'start-download',
Expand Down
4 changes: 0 additions & 4 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export interface ElectronAPI {
onDefaultInstallLocation: (callback: (location: string) => void) => void;
sendReady: () => void;
restartApp: (customMessage?: string, delay?: number) => void;
onOpenDevTools: (callback: () => void) => void;
isPackaged: () => Promise<boolean>;
openDialog: (options: Electron.OpenDialogOptions) => Promise<string[] | undefined>;
/**
Expand Down Expand Up @@ -81,9 +80,6 @@ const electronAPI: ElectronAPI = {
console.log('Sending restarting app message to main process with custom message: ', customMessage);
ipcRenderer.send(IPC_CHANNELS.RESTART_APP, { customMessage, delay });
},
onOpenDevTools: (callback: () => void) => {
ipcRenderer.on(IPC_CHANNELS.OPEN_DEVTOOLS, () => callback());
},
onShowSelectDirectory: (callback: () => void) => {
ipcRenderer.on(IPC_CHANNELS.SHOW_SELECT_DIRECTORY, () => callback());
},
Expand Down
6 changes: 1 addition & 5 deletions src/tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,9 @@ export function SetupTray(
click: () => shell.openPath(app.getPath('logs')),
},
{
label: 'Open devtools (Electron)',
label: 'Open devtools',
click: () => mainView.webContents.openDevTools(),
},
{
label: 'Open devtools (ComfyUI)',
click: () => mainView.webContents.send(IPC_CHANNELS.OPEN_DEVTOOLS),
},
{
label: 'Install Python Packages (Open Terminal)',
click: () => {
Expand Down

0 comments on commit 8df5776

Please sign in to comment.