0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-24 22:41:28 -05:00

fix(console): allow dev tenant deletion (#4869)

This commit is contained in:
Xiao Yijun 2023-11-13 15:03:18 +08:00 committed by GitHub
parent 0c923acbe3
commit 13fdc51ec8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,8 +31,14 @@ const tenantProfileToForm = (tenant?: TenantResponse): TenantSettingsForm => {
function TenantBasicSettings() {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
const api = useCloudApi();
const { currentTenant, currentTenantId, updateTenant, removeTenant, navigateTenant } =
useContext(TenantsContext);
const {
currentTenant,
currentTenantId,
isDevTenant,
updateTenant,
removeTenant,
navigateTenant,
} = useContext(TenantsContext);
const [isDeletionModalOpen, setIsDeletionModalOpen] = useState(false);
const [isDeleting, setIsDeleting] = useState(false);
const { show: showModal } = useConfirmModal();
@ -76,8 +82,9 @@ function TenantBasicSettings() {
const onClickDeletionButton = async () => {
if (
currentTenant?.subscription.planId !== ReservedPlanId.free ||
currentTenant.openInvoices.length > 0
!isDevTenant &&
(currentTenant?.subscription.planId !== ReservedPlanId.free ||
currentTenant.openInvoices.length > 0)
) {
await showModal({
title: 'tenants.delete_modal.cannot_delete_title',