diff --git a/ui/src/components/access/AccessFormTelegramBotConfig.tsx b/ui/src/components/access/AccessFormTelegramBotConfig.tsx index 77b9afa1..3181c71d 100644 --- a/ui/src/components/access/AccessFormTelegramBotConfig.tsx +++ b/ui/src/components/access/AccessFormTelegramBotConfig.tsx @@ -37,7 +37,7 @@ const AccessFormTelegramBotConfig = ({ form: formInst, formName, disabled, initi .nullish() .refine((v) => { if (v == null || v + "" === "") return true; - return /^\d+$/.test(v + "") && +v! > 0; + return !Number.isNaN(+v!) && +v! !== 0; }, t("access.form.telegram_bot_default_chat_id.placeholder")) ) .nullish(), @@ -72,7 +72,7 @@ const AccessFormTelegramBotConfig = ({ form: formInst, formName, disabled, initi rules={[formRule]} tooltip={} > - + ); diff --git a/ui/src/components/workflow/node/NotifyNodeConfigFormTelegramBotConfig.tsx b/ui/src/components/workflow/node/NotifyNodeConfigFormTelegramBotConfig.tsx index b4e4092e..a40142ee 100644 --- a/ui/src/components/workflow/node/NotifyNodeConfigFormTelegramBotConfig.tsx +++ b/ui/src/components/workflow/node/NotifyNodeConfigFormTelegramBotConfig.tsx @@ -37,7 +37,7 @@ const NotifyNodeConfigFormTelegramBotConfig = ({ .nullish() .refine((v) => { if (v == null || v + "" === "") return true; - return /^\d+$/.test(v + "") && +v! > 0; + return !Number.isNaN(+v!) && +v! !== 0; }, t("workflow_node.notify.form.telegram_bot_chat_id.placeholder")) ) .nullish(), @@ -63,7 +63,7 @@ const NotifyNodeConfigFormTelegramBotConfig = ({ rules={[formRule]} tooltip={} > - + );