From dd88e75413ab4070e908f928d75ce14eb8d1b7f5 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 5 Jan 2025 15:54:41 -0600 Subject: [PATCH] Omit NEXT_REDIRECT error output --- src/photo/form/PhotoForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/photo/form/PhotoForm.tsx b/src/photo/form/PhotoForm.tsx index 5e1750c1..5d836b43 100644 --- a/src/photo/form/PhotoForm.tsx +++ b/src/photo/form/PhotoForm.tsx @@ -282,7 +282,11 @@ export default function PhotoForm({ ? createPhotoAction : updatePhotoAction )(data) - .catch(e => setFormActionErrorMessage(e.message))} + .catch(e => { + if (e.message !== 'NEXT_REDIRECT') { + setFormActionErrorMessage(e.message); + } + })} onSubmit={() => { setFormActionErrorMessage(''); (document.activeElement as HTMLElement)?.blur?.();