feature/IO-3255-simplified-parts-management - Cleanup

This commit is contained in:
Dave
2025-08-14 22:50:59 -04:00
parent 9dd34c9f6c
commit b09b8b4f34
2 changed files with 5 additions and 5 deletions

View File

@@ -68,9 +68,9 @@ export function App({
useEffect(() => {
const pathname = window.location.pathname;
const isParts = pathname === "/parts" || pathname.startsWith("/parts/") || bodyshop?.external_shop_id;
const isParts = pathname === "/parts" || pathname.startsWith("/parts/");
setIsPartsEntry(isParts);
}, [setIsPartsEntry, bodyshop?.external_shop_id]);
}, [setIsPartsEntry]);
//const b = Grid.useBreakpoint();
// console.log("Breakpoints:", b);

View File

@@ -385,14 +385,14 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
const regionSeg = payload.region_config ? `region:${payload.region_config}` : null;
const segments = [instanceSeg, ...(regionSeg ? [regionSeg] : []), ...featureSegments];
if (isParts || payload.features.partsManagementOnly) {
if (isParts) {
segments.push(InstanceRenderManager({ imex: "ImexPartsManagement", rome: "RomePartsManagement" }));
}
window.$crisp.push(["set", "session:segments", [segments]]);
// Hide/show Crisp chat based on parts mode or features
window.$crisp.push(["do", isParts || payload.features.partsManagementOnly ? "chat:hide" : "chat:show"]);
window.$crisp.push(["do", isParts ? "chat:hide" : "chat:show"]);
InstanceRenderManager({
executeFunction: true,
@@ -403,7 +403,7 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
});
// Set whether it is for parts management only
yield put(setPartsManagementOnly(isParts || payload.features.partsManagementOnly));
yield put(setPartsManagementOnly(payload.features.partsManagementOnly));
} catch (error) {
console.warn("Couldnt find $crisp.", error.message);
}