program finalizat

This commit is contained in:
andrei-mihnea-cerbu
2024-10-29 15:07:26 +02:00
parent ab1eaec413
commit 979539d3db
138 changed files with 14602 additions and 5068 deletions
+15 -4
View File
@@ -24,13 +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
}
}