From 3199fd59d3bdec21edb9aba4fe94c67ce05f736c Mon Sep 17 00:00:00 2001 From: Kris Date: Fri, 31 Mar 2023 10:41:01 -0400 Subject: [PATCH] DEV: ensure class removal when banner doesn't show (#30) --- .../discourse/components/discourse-category-banners.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/javascripts/discourse/components/discourse-category-banners.js b/javascripts/discourse/components/discourse-category-banners.js index 6caf00b..3842ec5 100644 --- a/javascripts/discourse/components/discourse-category-banners.js +++ b/javascripts/discourse/components/discourse-category-banners.js @@ -42,7 +42,12 @@ export default class DiscourseCategoryBanners extends Component { } get shouldRender() { - return this.isVisible && this.keepDuringLoadingRoute; + if (this.isVisible && this.keepDuringLoadingRoute) { + return true; + } else { + document.body.classList.remove("category-header"); + return false; + } } get safeStyle() {