From ddf6aab1ad7fc18e1b9612fa3085c22aecd7444a Mon Sep 17 00:00:00 2001 From: Bogdan Crisan Date: Thu, 28 Nov 2024 16:10:58 +0100 Subject: [PATCH] Fix bug where you can't sort by market cap --- .../frontend/src/lib/queries/sorting/query-params.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/typescript/frontend/src/lib/queries/sorting/query-params.ts b/src/typescript/frontend/src/lib/queries/sorting/query-params.ts index 66c4514d7b..80975b1270 100644 --- a/src/typescript/frontend/src/lib/queries/sorting/query-params.ts +++ b/src/typescript/frontend/src/lib/queries/sorting/query-params.ts @@ -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"; export type HomePageSearchParams = { page: string | undefined; @@ -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); }