mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 12:36:26 +08:00

ff815384 introduced a modifier which changes tracked state. If the conditions are correct, this can cause an infinite re-rendering loop. One example is [here](https://meta.discourse.org/t/346215/4), although there are other non-dev-tools things which could trigger this kind of loop. As a general rule, modifiers should not change tracked state. This commit changes the approach to match the rest of the new-post-menu assumptions: instead of trying to modify `collapsed` at runtime, the rendering of individual buttons has the `>1` logic. That matches the existing logic [here](https://github.com/discourse/discourse/blob/89ff7d51e6/app/assets/javascripts/discourse/app/components/post/menu.gjs#L392C18-L394C6).