diff --git a/web/src/hooks/queries/useMyCasesCounterQuery.ts b/web/src/hooks/queries/useMyCasesCounterQuery.ts index df891cf60..c12ba1324 100644 --- a/web/src/hooks/queries/useMyCasesCounterQuery.ts +++ b/web/src/hooks/queries/useMyCasesCounterQuery.ts @@ -9,6 +9,7 @@ export type { MyCasesCounterQuery }; const myCasesCounter = graphql(` query MyCasesCounter($id: ID!, $where: Dispute_filter) { user(id: $id) { + totalAppealingDisputes disputes(orderBy: lastPeriodChange, where: $where) { id } diff --git a/web/src/pages/Dashboard/index.tsx b/web/src/pages/Dashboard/index.tsx index 5eea8c05c..9043a0dc8 100644 --- a/web/src/pages/Dashboard/index.tsx +++ b/web/src/pages/Dashboard/index.tsx @@ -5,7 +5,7 @@ import { DisputeDetailsFragment, useMyCasesQuery } from "queries/useCasesQuery"; import { useFiltersContext } from "context/FilterProvider"; import { useMyCasesCounterQuery } from "queries/useMyCasesCounterQuery"; import { useUserQuery, UserQuery } from "queries/useUser"; -import { OrderDirection, Period } from "src/graphql/graphql"; +import { OrderDirection } from "src/graphql/graphql"; import JurorInfo from "./JurorInfo"; import Courts from "./Courts"; import CasesDisplay from "components/CasesDisplay"; @@ -63,8 +63,8 @@ const Dashboard: React.FC = () => { const disputeSkip = debouncedSearch ? 0 : 3 * (currentPage - 1); const direction = timeFilter === 0 ? OrderDirection.Desc : OrderDirection.Asc; const courtChoice = courtFilter === 0 ? {} : { court: courtFilter.toString() }; - const { data: userAppealCases } = useMyCasesCounterQuery(address, { period: Period.Appeal, ...courtChoice }); - const userAppealCasesNumber = userAppealCases?.user?.disputes.length; + const { data: userAppealCases } = useMyCasesCounterQuery(address, { ...courtChoice }); + const userAppealCasesNumber = userAppealCases?.user?.totalAppealingDisputes; const queryFilters = { ...combinedQueryFilters, ...courtChoice }; const { data: disputesData } = useMyCasesQuery(address, disputeSkip, queryFilters, direction); const { data: userData } = useUserQuery(address);