FIX: ensures card cloak is removed (#9582)

FIX: ensures card cloak is removed (#9582)

Repro steps for current failure:

  • use mobile view
  • click on a different user avatar to show user card
  • click message
  • close composer
  • cloak is still showing and prevents any click
diff --git a/app/assets/javascripts/discourse/app/components/group-card-contents.js b/app/assets/javascripts/discourse/app/components/group-card-contents.js
index 7188469..c4aafe5 100644
--- a/app/assets/javascripts/discourse/app/components/group-card-contents.js
+++ b/app/assets/javascripts/discourse/app/components/group-card-contents.js
@@ -65,9 +65,9 @@ export default Component.extend(CardContentsBase, CleansUp, {
   },
 
   _close() {
-    this._super(...arguments);
-
     this.set("group", null);
+
+    this._super(...arguments);
   },
 
   cleanUp() {
diff --git a/app/assets/javascripts/discourse/app/components/user-card-contents.js b/app/assets/javascripts/discourse/app/components/user-card-contents.js
index b4f0e5c..6295456 100644
--- a/app/assets/javascripts/discourse/app/components/user-card-contents.js
+++ b/app/assets/javascripts/discourse/app/components/user-card-contents.js
@@ -177,12 +177,12 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
   },
 
   _close() {
-    this._super(...arguments);
-
     this.setProperties({
       user: null,
       topicPostCount: null
     });
+
+    this._super(...arguments);
   },
 
   cleanUp() {
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 2f53c52..b1aeb85 100644
--- a/app/assets/javascripts/discourse/app/mixins/card-contents-base.js
+++ b/app/assets/javascripts/discourse/app/mixins/card-contents-base.js
@@ -280,6 +280,8 @@ export default Mixin.create({
     if (this.site.mobileView) {
       this._unbindMobileScroll();
     }
+
+    this._hide();
   },
 
   willDestroyElement() {

GitHub sha: 4eed8691

This commit has been mentioned on Discourse Meta. There might be relevant details there:

This commit appears in #9582 which was approved by davidtaylorhq. It was merged by jjaffeux.