From 9b0b60274a2e227da5d62e68d5bd7b112a5eda8f Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 7 Feb 2023 15:36:30 +0100 Subject: [PATCH] FIX: ensures non existing user/group cards are not stuck (#20195) Prior to this fix on mobile the card-cloak would not get removed if the user/group card was leading to a non existing user/group. The fix ensures hidden class is removed each time we call show. --- .../javascripts/discourse/app/mixins/card-contents-base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/mixins/card-contents-base.js b/app/assets/javascripts/discourse/app/mixins/card-contents-base.js index 4e778f0ae22..08c9ba26eee 100644 --- a/app/assets/javascripts/discourse/app/mixins/card-contents-base.js +++ b/app/assets/javascripts/discourse/app/mixins/card-contents-base.js @@ -81,6 +81,7 @@ export default Mixin.create({ post, }); + document.querySelector(".card-cloak")?.classList.remove("hidden"); this.appEvents.trigger("user-card:show", { username }); this._showCallback(username, $(target)).then((user) => { this.appEvents.trigger("user-card:after-show", { user }); @@ -217,7 +218,6 @@ export default Mixin.create({ ], }); } else { - document.querySelector(".card-cloak")?.classList.remove("hidden"); this._popperReference = createPopper(target[0], this.element, { modifiers: [ { name: "eventListeners", enabled: false },