Skip to content

updated dashboard#192

Merged
zakkiyyat merged 2 commits into
MixMatch-Inc:mainfrom
chemicalcommando:ft/dashboard
Jun 22, 2026
Merged

updated dashboard#192
zakkiyyat merged 2 commits into
MixMatch-Inc:mainfrom
chemicalcommando:ft/dashboard

Conversation

@chemicalcommando

Copy link
Copy Markdown
Contributor

closes #188

@zakkiyyat zakkiyyat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address

Comment on lines +12 to +20
useEffect(() => {
if (!user) {
router.replace('/login');
}
}, [user, router]);

if (!user) return null;

return (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auth guard destructs user from useAuth() but ignores isLoading. On first render user is null (localStorage hasn't been read yet), so the guard fires router.replace('/login') immediately — an authenticated user gets bounced to login and back in a flash. The fix is to wait until isLoading === false before evaluating user.

@zakkiyyat zakkiyyat merged commit 5710fa2 into MixMatch-Inc:main Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Web] Restaurant dashboard — layout, shell, sidebar navigation, and auth guard

2 participants