From 42ae0978a5bd518184659bb949445cff0b702b2f Mon Sep 17 00:00:00 2001 From: yingying Date: Sat, 30 Nov 2024 15:43:44 +0800 Subject: [PATCH] fix: sovle the rerender of the edit page --- client/app/factory/edit/page.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/app/factory/edit/page.tsx b/client/app/factory/edit/page.tsx index c8e302ae..beef4fcb 100644 --- a/client/app/factory/edit/page.tsx +++ b/client/app/factory/edit/page.tsx @@ -98,7 +98,10 @@ export default function Edit() { }, [language]); useEffect(() => { - if (!user || status !== 'success' || user.id.startsWith('client|')) { + if (status === 'pending') { + return; + } + if (!user || user.id.startsWith('client|')) { router.push(`${apiDomain}/api/auth/login`); } else { if (!user?.agreement_accepted) {