From 2d074ad4a5f5370c135bc2c939f37c9453c296d6 Mon Sep 17 00:00:00 2001 From: Jan Cernik <66427541+jancernik@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:29:22 -0300 Subject: [PATCH] FIX: Hide suggestion to send PMs when PMs are disabled for user (#26157) --- .../app/routes/build-private-messages-route.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/app/routes/build-private-messages-route.js b/app/assets/javascripts/discourse/app/routes/build-private-messages-route.js index 26ad188628b..34dd2daa4d4 100644 --- a/app/assets/javascripts/discourse/app/routes/build-private-messages-route.js +++ b/app/assets/javascripts/discourse/app/routes/build-private-messages-route.js @@ -107,12 +107,14 @@ export default (inboxType, path, filter) => { emptyState() { const title = I18n.t("user.no_messages_title"); - const body = htmlSafe( - I18n.t("user.no_messages_body", { - aboutUrl: getURL("/about"), - icon: iconHTML("envelope"), - }) - ); + const body = this.currentUser?.can_send_private_messages + ? htmlSafe( + I18n.t("user.no_messages_body", { + aboutUrl: getURL("/about"), + icon: iconHTML("envelope"), + }) + ) + : ""; return { title, body }; },