Skip to content

Commit

Permalink
fix: fallback to empty value in key editor
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrees committed Oct 30, 2022
1 parent f1a7211 commit 11a0456
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const SettingsView = ({
<Card padding={3}>
<Stack space={3}>
{keys.map((keyEntry) => (
<SettingsKeEntry
<SettingsKeyEntry
key={keyEntry.key}
keyEntry={keyEntry}
loading={loading}
Expand All @@ -64,7 +64,7 @@ interface SettingsKeyProps {
keyEntry: SettingsKey
}

function SettingsKeEntry({loading, setNewSecrets, newSecrets, keyEntry}: SettingsKeyProps) {
function SettingsKeyEntry({loading, setNewSecrets, newSecrets, keyEntry}: SettingsKeyProps) {
const onChange = useCallback(
(event: React.FormEvent<HTMLInputElement>) => {
const target = event.currentTarget
Expand All @@ -88,7 +88,7 @@ function SettingsKeEntry({loading, setNewSecrets, newSecrets, keyEntry}: Setting
{keyEntry.description}
</Text>
)}
<TextInput disabled={loading} onChange={onChange} value={newSecrets[keyEntry.key]} />
<TextInput disabled={loading} onChange={onChange} value={newSecrets[keyEntry.key] ?? ''} />
</Stack>
)
}

0 comments on commit 11a0456

Please sign in to comment.