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

@@ -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'),
});

View File

@@ -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;

View File

@@ -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');
}
}
});
}