From bfb027310f73ff50ac98a33ceee18e8804d6fb7a Mon Sep 17 00:00:00 2001 From: Regalijan Date: Sun, 5 Nov 2023 00:12:02 -0400 Subject: [PATCH] Disable revoke button if ticket link does not match format --- app/routes/hammer.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/routes/hammer.tsx b/app/routes/hammer.tsx index c6e9171..cf17636 100644 --- a/app/routes/hammer.tsx +++ b/app/routes/hammer.tsx @@ -67,6 +67,7 @@ export default function () { const [loading, setLoading] = useState(false); const { isOpen, onClose, onOpen } = useDisclosure(); const toast = useToast(); + const ticketRegex = /https:\/\/carcrushers\.modmail\.dev\/logs\/[a-f\d]{12}$/; async function getHistory() { setVisible(false); @@ -260,11 +261,7 @@ export default function () { maxLength={49} /> - {ticketLink.match( - /https:\/\/carcrushers\.modmail\.dev\/logs\/[a-f\d]{12}$/, - ) - ? validIcon - : invalidIcon} + {ticketLink.match(ticketRegex) ? validIcon : invalidIcon} @@ -279,6 +276,7 @@ export default function () {