From c3de5af1f2e99c22bb5dbc606b05ef0efc55cc65 Mon Sep 17 00:00:00 2001 From: itsskaiya Date: Thu, 20 Nov 2025 14:53:32 -0500 Subject: [PATCH] Added dev tools support --- main.js | 7 +++++-- package.json | 2 +- src/preload.js | 1 + src/updateNotification.js | 2 +- src/utils/keybinds.js | 12 +++++++++--- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/main.js b/main.js index f4b3c82..1eaade6 100644 --- a/main.js +++ b/main.js @@ -67,7 +67,6 @@ function createWindow() { mainWindow.loadFile('views/index.html'); mainWindow.setMenu(null); - // mainWindow.webContents.openDevTools(); } app.whenReady().then(() => { @@ -95,4 +94,8 @@ ipcMain.handle('api:search', apiHandlers.search); ipcMain.handle('db:getFavorites', dbHandlers.getFavorites); ipcMain.handle('db:addFavorite', dbHandlers.addFavorite); -ipcMain.handle('db:removeFavorite', dbHandlers.removeFavorite); \ No newline at end of file +ipcMain.handle('db:removeFavorite', dbHandlers.removeFavorite); + +ipcMain.on('toggle-dev-tools', (event) => { + event.sender.toggleDevTools(); +}); \ No newline at end of file diff --git a/package.json b/package.json index 5cd6f8f..ea17108 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "waifu-board", - "version": "v1.4.0", + "version": "v1.4.1", "description": "An image board app to store and browse your favorite waifus!", "main": "main.js", "scripts": { diff --git a/src/preload.js b/src/preload.js index 1c19fb3..389eb9b 100644 --- a/src/preload.js +++ b/src/preload.js @@ -7,6 +7,7 @@ contextBridge.exposeInMainWorld('api', { removeFavorite: (id) => ipcRenderer.invoke('db:removeFavorite', id), search: (source, query) => ipcRenderer.invoke('api:search', source, query), + toggleDevTools: () => ipcRenderer.send('toggle-dev-tools'), getSources: () => ipcRenderer.invoke('api:getSources'), }); \ No newline at end of file diff --git a/src/updateNotification.js b/src/updateNotification.js index 345b622..71037bf 100644 --- a/src/updateNotification.js +++ b/src/updateNotification.js @@ -1,6 +1,6 @@ const GITHUB_OWNER = 'ItsSkaiya'; const GITHUB_REPO = 'WaifuBoard'; -const CURRENT_VERSION = 'v1.4.0'; +const CURRENT_VERSION = 'v1.4.1'; const UPDATE_CHECK_INTERVAL = 5 * 60 * 1000; let currentVersionDisplay; diff --git a/src/utils/keybinds.js b/src/utils/keybinds.js index e6b4d8d..ff0533d 100644 --- a/src/utils/keybinds.js +++ b/src/utils/keybinds.js @@ -1,7 +1,13 @@ -export function setupGlobalKeybinds(searchModal) { +export function setupGlobalKeybinds() { document.addEventListener('keydown', (e) => { - if (e.key === 'Escape') { - searchModal.classList.add('hidden'); + if (e.altKey && (e.key === 'i' || e.key === 'I')) { + e.preventDefault(); + + if (window.api && window.api.toggleDevTools) { + window.api.toggleDevTools(); + } else { + console.warn('window.api.toggleDevTools is not defined in preload.js'); + } } }); } \ No newline at end of file