Skip to content

Commit 3843234

Browse files
committed
improvement(byok): guard double-submit, Enter-to-save on key field, cap hint in manage modal
1 parent 3f6e3e7 commit 3843234

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok-key-manager.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export function BYOKKeyManager(props: BYOKKeyManagerProps) {
202202
}
203203

204204
const handleSave = async () => {
205-
if (!editing || !apiKeyInput.trim()) return
205+
if (!editing || !apiKeyInput.trim() || isSaving) return
206206

207207
setError(null)
208208
try {
@@ -406,6 +406,9 @@ export function BYOKKeyManager(props: BYOKKeyManagerProps) {
406406
}}
407407
placeholder={editingMeta?.placeholder}
408408
className={CHIP_FIELD_INPUT}
409+
onKeyDown={(e) => {
410+
if (e.key === 'Enter') handleSave()
411+
}}
409412
name='byok_api_key'
410413
autoComplete='off'
411414
autoCorrect='off'

apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok-provider-keys-modal.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ export function BYOKProviderKeysModal({
6464
</div>
6565
))}
6666
</div>
67+
{atCapacity && (
68+
<p className='px-2 text-[12px] text-[var(--text-muted)]'>
69+
Key limit reached ({maxKeys} keys per provider).
70+
</p>
71+
)}
6772
</ChipModalBody>
6873
<ChipModalFooter
6974
onCancel={close}

0 commit comments

Comments
 (0)