FIX: Preserve history when routing to `/filter` route (#29929)
This commit is contained in:
parent
fd22dd179a
commit
5605bab2c2
|
@ -1,10 +1,11 @@
|
|||
import { setTopicList } from "discourse/lib/topic-list-tracker";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
export default class DiscoveryFilterRoute extends DiscourseRoute {
|
||||
queryParams = {
|
||||
q: { replace: true, refreshModel: true },
|
||||
q: { refreshModel: true },
|
||||
};
|
||||
|
||||
async model(data) {
|
||||
|
@ -19,7 +20,7 @@ export default class DiscoveryFilterRoute extends DiscourseRoute {
|
|||
}
|
||||
|
||||
titleToken() {
|
||||
const filterText = i18n("filters.filter.title");
|
||||
return i18n("filters.with_topics", { filter: filterText });
|
||||
const query = this.paramsFor(this.routeName).q;
|
||||
return i18n("filters.filter.title", { filter: escapeExpression(query) });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4352,7 +4352,7 @@ en:
|
|||
with_topics: "%{filter} topics"
|
||||
with_category: "%{filter} %{category} topics"
|
||||
filter:
|
||||
title: "Filter"
|
||||
title: "Filtered results for %{filter}"
|
||||
button:
|
||||
label: "Filter"
|
||||
latest:
|
||||
|
|
Loading…
Reference in New Issue