fix: corrige a tela de logs que ficava vazia ao abrir a tela de configuracao depois da primeira vez

This commit is contained in:
VPS 4 Builder
2026-05-28 03:55:12 +02:00
parent 347b96b1b0
commit 72acf0ebfc
4 changed files with 27 additions and 1 deletions
+8
View File
@@ -9,6 +9,7 @@ let configWindow = null;
let monitorProcess = null;
let currentStatus = { connected: false, identified: false };
let downloadProgress = null; // Variável para controlar o progresso de download
const recentLogs = [];
// ================================================================
// AUTO-UPDATER CONFIG
@@ -145,6 +146,9 @@ function startMonitorProcess() {
currentStatus.identified = message.identified;
updateTrayMenu();
} else if (message && message.event === 'log') {
recentLogs.push(message.log);
if (recentLogs.length > 100) recentLogs.shift();
if (configWindow && !configWindow.isDestroyed()) {
configWindow.webContents.send('new-log', message.log);
}
@@ -326,6 +330,10 @@ ipcMain.handle('get-version', () => {
return app.getVersion();
});
ipcMain.handle('get-logs', () => {
return recentLogs;
});
ipcMain.handle('save-config', (event, newConfig) => {
const success = saveConfig(newConfig);
if (success) {