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
+17
View File
@@ -45,6 +45,23 @@ document.addEventListener('DOMContentLoaded', async () => {
const badge = document.getElementById('app-version-badge');
if (badge) badge.innerText = `Client v${version}`;
}
if (window.api && window.api.getLogs) {
const logs = await window.api.getLogs();
if (logs && logs.length > 0) {
const terminalLogs = document.getElementById('terminal-logs');
if (terminalLogs) {
terminalLogs.innerHTML = ''; // clear wait message
logs.forEach(log => {
const div = document.createElement('div');
div.className = 'log-line';
div.textContent = log;
terminalLogs.appendChild(div);
});
terminalLogs.scrollTop = terminalLogs.scrollHeight;
}
}
}
loadedConfig = await window.api.getConfig();