Skip to content

Commit d7560e1

Browse files
authored
🤖 feat: add clear option for API keys in settings (#782)
Adds a "Clear" button for secret fields (API keys, tokens, etc.) in the Providers settings section. Previously this button only appeared for text fields. _Generated with `mux`_
1 parent 598be86 commit d7560e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/browser/components/Settings/sections/ProvidersSection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ export function ProvidersSection() {
269269
: (fieldValue ?? "Default")}
270270
</span>
271271
<div className="flex gap-2">
272-
{fieldConfig.type === "text" && fieldValue && (
272+
{(fieldConfig.type === "text"
273+
? !!fieldValue
274+
: fieldConfig.type === "secret" && fieldIsSet) && (
273275
<button
274276
type="button"
275277
onClick={() => void handleClearField(provider, fieldConfig.key)}

0 commit comments

Comments
 (0)