Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 1c876b9

Browse files
committed
fix: search page toggle not updating
Refs: TILA-3496
1 parent 713e409 commit 1c876b9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/ui/modules/search.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,19 @@ export function mapSingleParamToFormValue(
220220
return param;
221221
}
222222

223+
// default to false if the param is present but not true, null if not present
223224
export function mapSingleBooleanParamToFormValue(
224225
param: string | string[] | undefined
225226
): boolean | null {
226227
if (param == null) return null;
227228
if (param === "") return null;
228229
if (Array.isArray(param)) {
229-
return param.find((p) => p === "true") != null ? true : null;
230+
const found = param.find((p) => p === "true");
231+
if (found != null) return true;
232+
if (param.length > 1) return false;
233+
return null;
230234
}
231-
return param === "true" ? true : null;
235+
return param === "true";
232236
}
233237

234238
export function mapQueryParamToNumber(

0 commit comments

Comments
 (0)