Skip to content

Commit

Permalink
fix: allow empty values for config fields that default to an empty st…
Browse files Browse the repository at this point in the history
…ring, closes #9
  • Loading branch information
Arcath committed Jun 27, 2023
1 parent 9dd0677 commit bccd5cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/routes/admin.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ export const action: ActionFunction = async ({request}) => {
await asyncForEach(keys(ConfigurableValues), async key => {
const value = formData.get(key) as string | undefined

invariant(value)
if (ConfigurableValues[key].value !== '') {
invariant(value)
}

const currentValue = await getConfigValue(key)

if (value !== currentValue) {
if (value !== currentValue && value !== undefined) {
await setConfigValue(key, value)
}
})
Expand Down

0 comments on commit bccd5cc

Please sign in to comment.