Skip to content

Commit

Permalink
Fix bug where you can't sort by market cap
Browse files Browse the repository at this point in the history
  • Loading branch information
CRBl69 committed Nov 28, 2024
1 parent 3a9a68f commit ddf6aab
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type OrderByStrings } from "@sdk/queries/const";
import { toMarketDataSortByHomePage, type SortByPageQueryParams } from "./types";
import { safeParsePageWithDefault } from "lib/routes/home-page-params";
import { SortMarketsBy } from "@sdk/indexer-v2/types/common";
import { DEFAULT_SORT_BY, SortMarketsBy } from "@sdk/indexer-v2/types/common";

Check failure on line 4 in src/typescript/frontend/src/lib/queries/sorting/query-params.ts

View workflow job for this annotation

GitHub Actions / pre-commit

Imports "SortMarketsBy" are only used as type

export type HomePageSearchParams = {
page: string | undefined;
Expand Down Expand Up @@ -33,7 +33,7 @@ export const constructURLForHomePage = ({
newURL.searchParams.set("q", searchBytes);
}
const newSort = toMarketDataSortByHomePage(sort);
if (newSort !== SortMarketsBy.MarketCap) {
if (newSort !== DEFAULT_SORT_BY) {
newURL.searchParams.set("sort", newSort);
}

Expand Down

0 comments on commit ddf6aab

Please sign in to comment.