mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
fix(sandbox): prevent revoking active provider config
Hide revoke button for active providers to avoid "no sandbox provider" error when user deletes the only available configuration.
This commit is contained in:
@ -151,8 +151,9 @@ function ConfigModal({ provider, onClose }: ConfigModalProps) {
|
||||
const providerLabelKey = PROVIDER_LABEL_KEYS[provider.provider_type as keyof typeof PROVIDER_LABEL_KEYS] ?? 'sandboxProvider.e2b.label'
|
||||
const providerLabel = t(providerLabelKey, { ns: 'common' })
|
||||
|
||||
// Only show revoke button when in BYOK mode and tenant has custom config
|
||||
const showRevokeButton = provider.is_tenant_configured && (!shouldShowModeSelection || configMode === 'byok')
|
||||
// Only show revoke button when in BYOK mode, tenant has custom config, and provider is not active
|
||||
// (active provider cannot be revoked to prevent "no sandbox provider" error)
|
||||
const showRevokeButton = provider.is_tenant_configured && !provider.is_active && (!shouldShowModeSelection || configMode === 'byok')
|
||||
const isActionDisabled = isSaving || isDeleting
|
||||
const showByokForm = !shouldShowModeSelection || configMode === 'byok'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user