Skip to content

A platform for community discussion. Free, open, simple.

FIX: Double Dismiss button for topic list on mobile (#40935)

Martin Brennanbbd9638e524f
diff --git a/frontend/discourse/app/components/discovery/topics.gjs b/frontend/discourse/app/components/discovery/topics.gjs
index dea11a4dc84..afe7df729f3 100644
--- a/frontend/discourse/app/components/discovery/topics.gjs
+++ b/frontend/discourse/app/components/discovery/topics.gjs
@@ -25,6 +25,8 @@ export default class DiscoveryTopics extends Component {
@service documentTitle;
@service currentUser;
@service topicTrackingState;
+ @service site;
+ @service siteSettings;
get redirectedReason() {
return this.currentUser?.user_option.redirected_to_top?.reason;
@@ -145,7 +147,12 @@ export default class DiscoveryTopics extends Component {
}
get showBottomDismissButtons() {
- return this.allLoaded;
+ return (
+ this.allLoaded &&
+ (!this.site.mobileView ||
+ (this.site.mobileView &&
+ !this.siteSettings.floating_dismiss_topics_on_mobile))
+ );
}
@action
diff --git a/frontend/discourse/tests/acceptance/mobile-new-dismiss-test.js b/frontend/discourse/tests/acceptance/mobile-new-dismiss-test.js
index f2f20ced903..8c878a99c75 100644
--- a/frontend/discourse/tests/acceptance/mobile-new-dismiss-test.js
+++ b/frontend/discourse/tests/acceptance/mobile-new-dismiss-test.js
@@ -17,12 +17,11 @@ acceptance("New dismiss - Mobile", function (needs) {
});
});
- test("shows the floating dismiss split-button but hides the bottom chevron on mobile", async function (assert) {
+ test("shows the floating dismiss split-button at the top, which is floating, but hides the bottom on mobile", async function (assert) {
await visit("/new");
assert.dom("#dismiss-new-top").exists();
assert.dom("#dismiss-new-menu-top .d-icon-chevron-down").exists();
- assert.dom("#dismiss-new-bottom").exists();
- assert.dom("#dismiss-new-menu-bottom").isNotVisible();
+ assert.dom("#dismiss-new-bottom").doesNotExist();
});
});