fmt
This commit is contained in:
parent
cf348c3ea4
commit
d1faad314b
14 changed files with 55 additions and 35 deletions
|
|
@ -215,7 +215,10 @@ export function useFilters({
|
|||
const normalizedOriginal = normalizeFilters(initialFilters);
|
||||
originalNormalizedRef.current = normalizedOriginal;
|
||||
const budget = filterLimit != null ? Math.max(0, filterLimit - reservedFilterSlots) : null;
|
||||
initialFiltersRef.current = clampToBudget(dropUnknownFilters(normalizedOriginal, features), budget);
|
||||
initialFiltersRef.current = clampToBudget(
|
||||
dropUnknownFilters(normalizedOriginal, features),
|
||||
budget
|
||||
);
|
||||
}
|
||||
|
||||
const [filters, setFilters] = useState<FeatureFilters>(() => initialFiltersRef.current!);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,10 @@ async function detectSessionRejection(
|
|||
onSessionRejected?: () => void
|
||||
): Promise<void> {
|
||||
if (res.status !== 400 || !onSessionRejected || !pb.authStore.isValid) return;
|
||||
const body = await res.clone().json().catch(() => null);
|
||||
const body = await res
|
||||
.clone()
|
||||
.json()
|
||||
.catch(() => null);
|
||||
if (body && (body as { error?: string }).error === 'filter_limit') {
|
||||
onSessionRejected();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue