diff --git a/CHANGELOG.md b/CHANGELOG.md index 1840673e..f0dcc6b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - [FIX] `flamegraph_mode` query param having no effect. [#635](https://github.com/MiniProfiler/rack-mini-profiler/pull/635) - [FEATURE] Show record type and count in SQL query UI. [#638](https://github.com/MiniProfiler/rack-mini-profiler/pull/638) - [FEATURE] Show Active Record QueryCache hits in UI. [#640](https://github.com/MiniProfiler/rack-mini-profiler/pull/640) +- [FIX] max_traces_to_show had chance to break the profiler frontend [#297](https://github.com/MiniProfiler/rack-mini-profiler/issues/297) ## 3.3.1 - 2024-02-15 - [FEATURE] Support dynamic `config.content_security_policy_nonce` [#609](https://github.com/MiniProfiler/rack-mini-profiler/pull/609) diff --git a/lib/html/includes.js b/lib/html/includes.js index 7797df28..daf252e4 100644 --- a/lib/html/includes.js +++ b/lib/html/includes.js @@ -285,10 +285,10 @@ var _MiniProfiler = (function() { }); // limit count if ( - container.querySelectorAll(".profiler-result").length > + container.querySelectorAll(".profiler-result:not(:has(.profiler-totals))").length > options.maxTracesToShow ) { - var elem = container.querySelector(".profiler-result"); + var elem = container.querySelector('.profiler-result:not(:has(.profiler-totals))'); if (elem) { elem.parentElement.removeChild(elem);