From 266390e88e3db88b1470f63a65d443570c4ca10d Mon Sep 17 00:00:00 2001 From: Andrew Smithwick Date: Fri, 12 Apr 2024 17:32:46 -0700 Subject: [PATCH] Use instanceof instead of === for error check --- .../admin/event/AdminPickupEvent/AdminPickupEventForm.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/admin/event/AdminPickupEvent/AdminPickupEventForm.tsx b/src/components/admin/event/AdminPickupEvent/AdminPickupEventForm.tsx index 7c7b1a66..d386012d 100644 --- a/src/components/admin/event/AdminPickupEvent/AdminPickupEventForm.tsx +++ b/src/components/admin/event/AdminPickupEvent/AdminPickupEventForm.tsx @@ -110,7 +110,7 @@ const AdminPickupEventForm = ({ mode, defaultData = {}, token, upcomingEvents }: ]); router.push(`${config.admin.store.pickup}/${uuid}`); } catch (error) { - if (error === RangeError) { + if (error instanceof RangeError) { reportError('Invalid date, could not create pickup event', error); } else { reportError('Could not create pickup event', error); @@ -164,7 +164,7 @@ const AdminPickupEventForm = ({ mode, defaultData = {}, token, upcomingEvents }: }, }); } catch (error) { - if (error === RangeError) { + if (error instanceof RangeError) { reportError("Invalid date, can't save changes", error); } else { reportError('Could not save changes', error);