Skip to content

Commit 1dc2a1f

Browse files
committed
Fix
1 parent 41a606f commit 1dc2a1f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/components/filters/use-filters.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {useNearbyCities} from "web/hooks/use-nearby-locations";
77
import {useEffectCheckEquality} from "web/hooks/use-effect-check-equality";
88
import {wantsKidsDatabase, wantsKidsDatabaseToWantsKidsFilter, wantsKidsToHasKidsFilter} from "common/wants-kids";
99
import {FilterFields, initialFilters, OriginLocation} from "common/filters";
10+
import {MAX_INT, MIN_INT} from "common/constants";
1011

1112
export const useFilters = (you: Lover | undefined) => {
1213
const isLooking = useIsLooking()
@@ -69,8 +70,8 @@ export const useFilters = (you: Lover | undefined) => {
6970
const yourFilters: Partial<FilterFields> = {
7071
genders: you?.pref_gender?.length ? you.pref_gender : undefined,
7172
pref_gender: you?.gender?.length ? [you.gender] : undefined,
72-
pref_age_max: (you?.pref_age_max ?? MAX_AGE) < 100 ? you?.pref_age_max : undefined,
73-
pref_age_min: (you?.pref_age_min ?? MIN_AGE) > 18 ? you?.pref_age_min : undefined,
73+
pref_age_max: (you?.pref_age_max ?? MAX_INT) < 100 ? you?.pref_age_max : undefined,
74+
pref_age_min: (you?.pref_age_min ?? MIN_INT) > 18 ? you?.pref_age_min : undefined,
7475
pref_relation_styles: you?.pref_relation_styles.length ? you.pref_relation_styles : undefined,
7576
wants_kids_strength: wantsKidsDatabaseToWantsKidsFilter(
7677
(you?.wants_kids_strength ?? 2) as wantsKidsDatabase

0 commit comments

Comments
 (0)