From 2559c763ad3ccff417b2673d6bb4fe9432565bba Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Wed, 5 Oct 2022 17:59:50 +0800 Subject: [PATCH] DEV: Fix message section link filters displaying icons (#18484) Follow-up to c0037dc0f06f08bd050aedc8aad97d1f05b322ab --- .../sidebar/user/messages-section/message-section-link.js | 8 ++++++-- .../acceptance/sidebar-user-messages-section-test.js | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/message-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/message-section-link.js index d1a10fefb0a..a28cebdeb7b 100644 --- a/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/message-section-link.js +++ b/app/assets/javascripts/discourse/app/lib/sidebar/user/messages-section/message-section-link.js @@ -73,10 +73,14 @@ export default class MessageSectionLink { } get prefixType() { - return "icon"; + if (this._isInbox) { + return "icon"; + } } get prefixValue() { - return "inbox"; + if (this._isInbox) { + return "inbox"; + } } } diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js index c42ba0d83e2..f3ac3f2f4b5 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js @@ -161,6 +161,13 @@ acceptance( ), `personal message ${type} link is marked as active` ); + + assert.notOk( + exists( + `.sidebar-section-messages .sidebar-section-link-personal-messages-${type} .sidebar-section-link-prefix` + ), + `prefix is not displayed for ${type} personal message section link` + ); }); });