mirror of
https://github.com/hexastack/hexabot
synced 2025-01-22 18:45:57 +00:00
fix(frontend): unhance check controls
This commit is contained in:
parent
c4a1c16b94
commit
e683a831e1
@ -268,7 +268,11 @@ const PatternInput: FC<PatternInputProps> = ({
|
||||
{...registerInput(t("message.regex_is_invalid"), idx, {
|
||||
validate: (pattern) => {
|
||||
try {
|
||||
if (typeof pattern === "string")
|
||||
if (
|
||||
pattern.at(0) === "/" &&
|
||||
pattern.at(-1) === "/" &&
|
||||
typeof pattern === "string"
|
||||
)
|
||||
new RegExp(pattern.slice(1, -1));
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user