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