FIX: Ensure subcategory list is hidden when not required (#14424)

FIX: Ensure subcategory list is hidden when not required (#14424)

When the loading spinner is removed (e.g. via the loading-slider component), the subcategory list view will persist, even when no longer required. This is because we were conditionally rendering the list into the header-list-container outlet. When the condition was false, we were doing nothing. Instead, we should use disconectOutlet to make sure the content is removed from the DOM.

diff --git a/app/assets/javascripts/discourse/app/routes/build-category-route.js b/app/assets/javascripts/discourse/app/routes/build-category-route.js
index 838be1d..f0922dc 100644
--- a/app/assets/javascripts/discourse/app/routes/build-category-route.js
+++ b/app/assets/javascripts/discourse/app/routes/build-category-route.js
@@ -192,6 +192,8 @@ export default (filterArg, params) => {
           outlet: "header-list-container",
           model: this._categoryList,
         });
+      } else {
+        this.disconnectOutlet({ outlet: "header-list-container" });
       }
       this.render("discovery/topics", {
         controller: "discovery/topics",

GitHub sha: 688e03fc42bddc2544774e74aa45b862144e4e8b

This commit appears in #14424 which was approved by CvX. It was merged by davidtaylorhq.