Skip to content

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

UX: Fix unread + new "topics remaining" links when unified new enabled (#41181)

Martin Brennan6b6bfb425b44
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 6f3a924e149..ec8954fb6f6 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -4287,25 +4287,25 @@ en:
true {
{ UNREAD, plural,
=0 {}
- one {There is <a href="{basePath}/unread"># unread</a>}
- other {There are <a href="{basePath}/unread"># unread</a>}
+ one {There is <a href="{unreadUrl}"># unread</a>}
+ other {There are <a href="{unreadUrl}"># unread</a>}
}
{ NEW, plural,
=0 {}
- one { and <a href="{basePath}/new"># new</a> topic remaining,}
- other { and <a href="{basePath}/new"># new</a> topics remaining,}
+ one { and <a href="{newUrl}"># new</a> topic remaining,}
+ other { and <a href="{newUrl}"># new</a> topics remaining,}
}
}
false {
{ UNREAD, plural,
=0 {}
- one {There is <a href="{basePath}/unread"># unread</a> topic remaining,}
- other {There are <a href="{basePath}/unread"># unread</a> topics remaining,}
+ one {There is <a href="{unreadUrl}"># unread</a> topic remaining,}
+ other {There are <a href="{unreadUrl}"># unread</a> topics remaining,}
}
{ NEW, plural,
=0 {}
- one {There is <a href="{basePath}/new"># new</a> topic remaining,}
- other {There are <a href="{basePath}/new"># new</a> topics remaining,}
+ one {There is <a href="{newUrl}"># new</a> topic remaining,}
+ other {There are <a href="{newUrl}"># new</a> topics remaining,}
}
}
other {}
diff --git a/frontend/discourse/app/components/more-topics/browse-more.gjs b/frontend/discourse/app/components/more-topics/browse-more.gjs
index 75e8ef97a0b..4d9e06ad015 100644
--- a/frontend/discourse/app/components/more-topics/browse-more.gjs
+++ b/frontend/discourse/app/components/more-topics/browse-more.gjs
@@ -11,6 +11,7 @@ export default class BrowseMore extends Component {
@service pmTopicTrackingState;
@service site;
@service topicTrackingState;
+ @service siteSettings;
groupLink(groupName) {
return `<a class="group-link" href="${getURL(
@@ -89,6 +90,12 @@ export default class BrowseMore extends Component {
HAS_CATEGORY: !!category,
categoryLink: category ? categoryBadgeHTML(category) : null,
basePath: getURL(""),
+ unreadUrl: this.siteSettings.enable_unified_new
+ ? getURL("/new?subset=replies")
+ : getURL("/unread"),
+ newUrl: this.siteSettings.enable_unified_new
+ ? getURL("/new?subset=topics")
+ : getURL("/new"),
});
} else if (category) {
return i18n("topic.read_more_in_category", {