fix: disco bug when logging out#658
Conversation
- also removes connected status from home page as per TASK-8183 - added reset setup state to reset to signup/login view when logging out
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes remove a temporary sign-in button from the mobile Home component and update the logic in the Welcome view to navigate only when a valid user is present along with the kernel being ready. Additionally, the logout mechanism in the Auth context now resets Redux state via a new reducer before navigating to the setup page. These adjustments streamline the UI and ensure that authentication state is handled consistently across components. Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/context/authContext.tsx (1)
315-315: Remove console.log statement.Remove the debug console.log statement before deploying to production.
- console.log({ user })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/app/(mobile-ui)/home/page.tsx(1 hunks)src/components/Setup/Views/Welcome.tsx(2 hunks)src/context/authContext.tsx(3 hunks)src/redux/slices/setup-slice.ts(1 hunks)
🔇 Additional comments (6)
src/components/Setup/Views/Welcome.tsx (2)
3-3: LGTM! Added user authentication check.The addition of the
useAuthhook and user state helps prevent premature navigation.Also applies to: 12-12
16-20: LGTM! Enhanced navigation guard.The updated condition ensures navigation only occurs when both the user is authenticated and the kernel client is ready, preventing potential race conditions.
src/redux/slices/setup-slice.ts (1)
21-27: LGTM! Comprehensive state reset implementation.The
resetSetupreducer properly resets all state properties to their initial values, ensuring a clean slate after logout.src/app/(mobile-ui)/home/page.tsx (1)
134-137: LGTM! Simplified mobile view.The removal of the connected status and sign-in button while retaining the logout functionality aligns with the PR objectives and simplifies the mobile UI.
src/context/authContext.tsx (2)
4-5: LGTM! Added Redux integration.The addition of Redux dispatch and setup actions enables proper state management during logout.
284-286: LGTM! Enhanced logout flow.The changes improve the logout flow by:
- Resetting setup state before navigation
- Using
router.replaceinstead ofpushto prevent back navigation to authenticated state
fixes TASK-8304
fixes TASK-8183
Summary by CodeRabbit