Added dev tools support
This commit is contained in:
7
main.js
7
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);
|
||||
ipcMain.handle('db:removeFavorite', dbHandlers.removeFavorite);
|
||||
|
||||
ipcMain.on('toggle-dev-tools', (event) => {
|
||||
event.sender.toggleDevTools();
|
||||
});
|
||||
@@ -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": {
|
||||
|
||||
@@ -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'),
|
||||
});
|
||||
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user