diff --git a/.eslintrc b/.eslintrc index 0ba14e06..2dfd33c9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -204,7 +204,7 @@ rules: no-undefined: [0] no-underscore-dangle: [0] no-unexpected-multiline: [2] - no-unmodified-loop-condition: [2] + no-unmodified-loop-condition: [1] no-unneeded-ternary: [2] no-unreachable: [2] no-unsafe-finally: [2] diff --git a/manage.js b/manage.js index 97b6f4eb..0a995de4 100644 --- a/manage.js +++ b/manage.js @@ -104,11 +104,10 @@ function showStyles(styles = []) { function renderStyles(index) { const t0 = performance.now(); - while (index < sorted.length) { + let rendered = 0; + while (index < sorted.length + && (shouldRenderAll || performance.now() - t0 < 10 || ++rendered < 10)) { renderBin.appendChild(createStyleElement(sorted[index++])); - if (!shouldRenderAll && performance.now() - t0 > 10) { - break; - } } filterAndAppend({container: renderBin}); if (index < sorted.length) {