feature/IO-3499-React-19: Bug Fixes / Checkpoint
This commit is contained in:
@@ -145,10 +145,16 @@ export function Manage({ conflict, bodyshop, partsManagementOnly, isDarkMode, cu
|
||||
}, [t]);
|
||||
|
||||
// This is a required safety check to prevent parts management only users from accessing /manage based routes
|
||||
useEffect(() => {
|
||||
if (partsManagementOnly && !import.meta.env.DEV) {
|
||||
// This NEEDS to be done this way, DO NOT use the react router, it will cause a ton of side effects
|
||||
window.location = "/parts";
|
||||
}
|
||||
}, [partsManagementOnly]);
|
||||
|
||||
// Prevent rendering if redirecting
|
||||
if (partsManagementOnly && !import.meta.env.DEV) {
|
||||
// This NEEDS to be done this way, DO NOT use the react router, it will cause a ton of side effects
|
||||
window.location = "/parts";
|
||||
return null; // Prevent further rendering
|
||||
return null;
|
||||
}
|
||||
|
||||
const AppRouteTable = (
|
||||
|
||||
Reference in New Issue
Block a user