fix: corrige a tela de logs que ficava vazia ao abrir a tela de configuracao depois da primeira vez
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user