optimize js mutation callbacks

This commit is contained in:
Vladimir Mandic
2024-05-16 10:42:07 -04:00
parent e5ac0b7dca
commit ecddde13a2
5 changed files with 35 additions and 23 deletions
+5 -3
View File
@@ -59,9 +59,11 @@ function setProgress(res) {
const el = document.getElementById(elId);
if (el) {
el.innerText = (res ? `${job} ${perc} ${eta}` : 'Generate');
el.style.background = res && (progress > 0)
? `linear-gradient(to right, var(--primary-500) 0%, var(--primary-800) ${perc}, var(--neutral-700) ${perc})`
: 'var(--button-primary-background-fill)';
if (!window.waitForUiReady) {
el.style.background = res && (progress > 0)
? `linear-gradient(to right, var(--primary-500) 0%, var(--primary-800) ${perc}, var(--neutral-700) ${perc})`
: 'var(--button-primary-background-fill)';
}
}
}
}