Added dev tools support

This commit is contained in:
2025-11-20 14:53:32 -05:00
parent aa5ac304bd
commit c3de5af1f2
5 changed files with 17 additions and 7 deletions

View File

@@ -67,7 +67,6 @@ function createWindow() {
mainWindow.loadFile('views/index.html'); mainWindow.loadFile('views/index.html');
mainWindow.setMenu(null); mainWindow.setMenu(null);
// mainWindow.webContents.openDevTools();
} }
app.whenReady().then(() => { app.whenReady().then(() => {
@@ -96,3 +95,7 @@ ipcMain.handle('api:search', apiHandlers.search);
ipcMain.handle('db:getFavorites', dbHandlers.getFavorites); ipcMain.handle('db:getFavorites', dbHandlers.getFavorites);
ipcMain.handle('db:addFavorite', dbHandlers.addFavorite); ipcMain.handle('db:addFavorite', dbHandlers.addFavorite);
ipcMain.handle('db:removeFavorite', dbHandlers.removeFavorite); ipcMain.handle('db:removeFavorite', dbHandlers.removeFavorite);
ipcMain.on('toggle-dev-tools', (event) => {
event.sender.toggleDevTools();
});

View File

@@ -1,6 +1,6 @@
{ {
"name": "waifu-board", "name": "waifu-board",
"version": "v1.4.0", "version": "v1.4.1",
"description": "An image board app to store and browse your favorite waifus!", "description": "An image board app to store and browse your favorite waifus!",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {

View File

@@ -7,6 +7,7 @@ contextBridge.exposeInMainWorld('api', {
removeFavorite: (id) => ipcRenderer.invoke('db:removeFavorite', id), removeFavorite: (id) => ipcRenderer.invoke('db:removeFavorite', id),
search: (source, query) => ipcRenderer.invoke('api:search', source, query), search: (source, query) => ipcRenderer.invoke('api:search', source, query),
toggleDevTools: () => ipcRenderer.send('toggle-dev-tools'),
getSources: () => ipcRenderer.invoke('api:getSources'), getSources: () => ipcRenderer.invoke('api:getSources'),
}); });

View File

@@ -1,6 +1,6 @@
const GITHUB_OWNER = 'ItsSkaiya'; const GITHUB_OWNER = 'ItsSkaiya';
const GITHUB_REPO = 'WaifuBoard'; const GITHUB_REPO = 'WaifuBoard';
const CURRENT_VERSION = 'v1.4.0'; const CURRENT_VERSION = 'v1.4.1';
const UPDATE_CHECK_INTERVAL = 5 * 60 * 1000; const UPDATE_CHECK_INTERVAL = 5 * 60 * 1000;
let currentVersionDisplay; let currentVersionDisplay;

View File

@@ -1,7 +1,13 @@
export function setupGlobalKeybinds(searchModal) { export function setupGlobalKeybinds() {
document.addEventListener('keydown', (e) => { document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') { if (e.altKey && (e.key === 'i' || e.key === 'I')) {
searchModal.classList.add('hidden'); e.preventDefault();
if (window.api && window.api.toggleDevTools) {
window.api.toggleDevTools();
} else {
console.warn('window.api.toggleDevTools is not defined in preload.js');
}
} }
}); });
} }