Skip to content

Commit aa838d1

Browse files
mastafitseambot
andauthored
fix: Unable to edit time_bound access codes (#656)
* Update AccessCodeForm.tsx * eslint fix * Full fix * Update AccessCodeForm.tsx * ci: Format code * Possible solution * Update AccessCodeForm.tsx * Remove redundant code --------- Co-authored-by: Seam Bot <[email protected]>
1 parent 9a513d7 commit aa838d1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib/ui/AccessCodeForm/AccessCodeForm.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ function Content({
8080
}
8181

8282
const start = startDate.toISO()
83-
if (start == null) {
83+
if (start === null) {
8484
throw new Error(`Invalid start date: ${startDate.invalidReason}`)
8585
}
8686

8787
const end = endDate.toISO()
88-
if (end == null) {
88+
if (end === null) {
8989
throw new Error(`Invalid end date: ${endDate.invalidReason}`)
9090
}
9191

@@ -172,8 +172,7 @@ function Content({
172172
? t.codeLengthRequirement(codeLengthRequirement)
173173
: null
174174

175-
const hasCodeInputs =
176-
accessCode?.type !== 'time_bound' || accessCode.is_offline_access_code
175+
const hasCodeInputs = accessCode?.is_offline_access_code !== true
177176

178177
return (
179178
<>

0 commit comments

Comments
 (0)