Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import I18n from "I18n";
import DiscourseUrl from "discourse/lib/url";
import { getOwner } from "discourse-common/lib/get-owner";

export default {
Expand Down Expand Up @@ -42,23 +41,11 @@ export default {

actions: {
changeStatus(newStatus) {
let location = window.location;
let queryStrings = location.search;
let params = queryStrings.startsWith("?")
? queryStrings.substr(1).split("&")
: [];

params = params.filter((param) => !param.startsWith("solved="));

const router = getOwner(this).lookup("router:main");
if (newStatus && newStatus !== "all") {
newStatus = newStatus === "solved" ? "yes" : "no";
params.push(`solved=${newStatus}`);
}

queryStrings = params.length > 0 ? `?${params.join("&")}` : "";
DiscourseUrl.routeTo(
`${location.pathname}${queryStrings}${location.hash}`
);
router.transitionTo({ queryParams: { solved: newStatus } });
},
},
};