mirror of
https://github.com/vladmandic/automatic
synced 2026-09-14 10:38:42 +02:00
optimize js mutation callbacks
This commit is contained in:
@@ -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)';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user