From 585d1e2f4d65a372bc8a27d673617ef4cc87dab9 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 14 Feb 2023 21:12:50 +0100 Subject: [PATCH] UX: hide chat button on user card when suspended (#20292) --- .../components/user-card-chat-button.hbs | 2 +- .../components/user-card-chat-button-test.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/chat/assets/javascripts/discourse/components/user-card-chat-button.hbs b/plugins/chat/assets/javascripts/discourse/components/user-card-chat-button.hbs index 764aa1ae8e6..2dd02ec8a75 100644 --- a/plugins/chat/assets/javascripts/discourse/components/user-card-chat-button.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/user-card-chat-button.hbs @@ -1,4 +1,4 @@ -{{#if this.chat.userCanDirectMessage}} +{{#if (and this.chat.userCanDirectMessage (not @user.suspended))}} `); + + assert.false( + exists(".user-card-chat-btn"), + "it doesn’t show the chat button" + ); + }); });