diff --git a/thirdeye-ui/src/app/components/create-alert-modal/create-alert-modal.component.tsx b/thirdeye-ui/src/app/components/create-alert-modal/create-alert-modal.component.tsx index 75f2051b55..8c78910865 100644 --- a/thirdeye-ui/src/app/components/create-alert-modal/create-alert-modal.component.tsx +++ b/thirdeye-ui/src/app/components/create-alert-modal/create-alert-modal.component.tsx @@ -110,7 +110,9 @@ export const CreateAlertModal: FunctionComponent = okButtonText: t("label.confirm"), cancelButtonText: t("label.cancel"), onOk: () => checkQuota(), - keepDialogOnOk: true, + keepDialogOnOk: !!( + remainingQuota && remainingQuota?.detection <= 0 + ), }); } else { checkQuota();