continue watching section, recently added section, new endpoints in collab with server, scan for new files, and more

This commit is contained in:
Brandon4466
2025-05-29 12:58:00 -07:00
parent 3e80923494
commit f8f04c19cf
6 changed files with 1201 additions and 37 deletions

24
main.js
View File

@@ -1,14 +1,31 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');
// Catch unhandled exceptions to prevent crashes
process.on('uncaughtException', (error) => {
console.error('Unhandled exception:', error);
});
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled rejection at:', promise, 'reason:', reason);
});
function createWindow() {
const win = new BrowserWindow({
width: 1000,
height: 700,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
preload: path.join(__dirname, 'preload.js'),
contextIsolation: true,
nodeIntegration: false,
sandbox: false // disable sandbox to enable Node built-ins in preload
}
});
win.webContents.on('preload-error', (event, preloadPath, error) => {
console.error(`Failed to load preload script from ${preloadPath}:`, error);
});
win.loadFile('index.html');
}
@@ -18,4 +35,9 @@ app.on('window-all-closed', () => {
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
app.on('renderer-process-crashed', (event, webContents, killed) => {
console.error('Renderer process crashed. Restarting...');
createWindow(); // Restart the renderer process
});