Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Unable to edit time_bound access codes #656

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/lib/ui/AccessCodeForm/AccessCodeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ function Content({
}

const start = startDate.toISO()
if (start == null) {
if (start === null) {
throw new Error(`Invalid start date: ${startDate.invalidReason}`)
}

const end = endDate.toISO()
if (end == null) {
if (end === null) {
throw new Error(`Invalid end date: ${endDate.invalidReason}`)
}

Expand Down Expand Up @@ -172,8 +172,7 @@ function Content({
? t.codeLengthRequirement(codeLengthRequirement)
: null

const hasCodeInputs =
accessCode?.type !== 'time_bound' || accessCode.is_offline_access_code
const hasCodeInputs = accessCode?.is_offline_access_code !== true

return (
<>
Expand Down
Loading