program finalizat
This commit is contained in:
@@ -24,12 +24,24 @@ function fadeOut(destination) {
|
||||
async function waitForResponse() {
|
||||
return new Promise((resolve) => {
|
||||
const idResponseCheck = setInterval(async () => {
|
||||
const status = await window.electronAPI.hasResponseArrived();
|
||||
if (status) {
|
||||
if (await window.electronAPI.hasResponseArrived()) {
|
||||
clearInterval(idResponseCheck);
|
||||
const response = await window.electronAPI.getLastUcResult();
|
||||
resolve(response || null); // Resolve the response or null if not available
|
||||
resolve(await window.electronAPI.getLastUcResult()); // Resolve the response or null if not available
|
||||
}
|
||||
}, 100); // Check every 100 milliseconds if the response has arrived
|
||||
});
|
||||
}
|
||||
|
||||
function toggleScroll(idComponent, scrollHeight = 180) {
|
||||
const element = document.getElementById(idComponent); // Using getElementById
|
||||
if (!element) {
|
||||
console.error(`Element with ID '${idComponent}' not found.`);
|
||||
return;
|
||||
}
|
||||
if (element.scrollHeight > scrollHeight) {
|
||||
element.style.overflowY = 'auto'; // Enable scroll if content overflows
|
||||
} else {
|
||||
element.style.overflowY = 'hidden'; // Disable scroll if content fits
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user