Skip to content

Commit bee480b

Browse files
fix: hide access code input when cannot_specify_pin_code constraint present (#719)
1 parent 1f7b1af commit bee480b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib/ui/AccessCodeForm/AccessCodeForm.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,13 @@ function Content({
172172
? t.codeLengthRequirement(codeLengthRequirement)
173173
: null
174174

175-
const hasCodeInputs = accessCode?.is_offline_access_code !== true
175+
const canSpecifyPinCode =
176+
device.properties.code_constraints?.every(
177+
({ constraint_type: type }) => type !== 'cannot_specify_pin_code'
178+
) ?? true
179+
180+
const hasCodeInputs =
181+
accessCode?.is_offline_access_code !== true && canSpecifyPinCode
176182

177183
return (
178184
<>

0 commit comments

Comments
 (0)