-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Active #10461
base: main
Are you sure you want to change the base?
fix: Active #10461
Conversation
Welcome!
Hello there, congrats on your first PR! We're excited to have you contributing to this project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added a check in RecordIndexPage to prevent access to disabled object views, redirecting users to NotFound page when attempting to access inactive objects.
- Reordered conditions in
/packages/twenty-front/src/pages/object-record/RecordIndexPage.tsx
to checkobjectMetadataItem?.isActive
after ensuringobjectMetadataItem
is defined to prevent potential undefined behavior - Added navigation to NotFound page when
isActive
is false, addressing issue I shouldn't be redirected to Companies when I've disabled Companies object #10064 where users could access disabled company views - Consider adding a loading state between the undefined check and active check to prevent flash of content
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
if (!objectMetadataItem?.isActive) { | ||
navigateApp(AppPath.NotFound); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing return statement after navigation - component will continue executing
if (!objectMetadataItem?.isActive) { | |
navigateApp(AppPath.NotFound); | |
} | |
if (!objectMetadataItem?.isActive) { | |
navigateApp(AppPath.NotFound); | |
return null; | |
} |
fix: #10064