Skip to content

Commit

Permalink
fix: sovle the rerender of the edit page
Browse files Browse the repository at this point in the history
  • Loading branch information
xingwanying committed Nov 30, 2024
1 parent 98898b3 commit 42ae097
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/app/factory/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 42ae097

Please sign in to comment.