feature/IO-3255-simplified-parts-management - Cleanup
This commit is contained in:
@@ -68,9 +68,9 @@ export function App({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const pathname = window.location.pathname;
|
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(isParts);
|
||||||
}, [setIsPartsEntry, bodyshop?.external_shop_id]);
|
}, [setIsPartsEntry]);
|
||||||
|
|
||||||
//const b = Grid.useBreakpoint();
|
//const b = Grid.useBreakpoint();
|
||||||
// console.log("Breakpoints:", b);
|
// console.log("Breakpoints:", b);
|
||||||
|
|||||||
@@ -385,14 +385,14 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
|||||||
|
|
||||||
const regionSeg = payload.region_config ? `region:${payload.region_config}` : null;
|
const regionSeg = payload.region_config ? `region:${payload.region_config}` : null;
|
||||||
const segments = [instanceSeg, ...(regionSeg ? [regionSeg] : []), ...featureSegments];
|
const segments = [instanceSeg, ...(regionSeg ? [regionSeg] : []), ...featureSegments];
|
||||||
if (isParts || payload.features.partsManagementOnly) {
|
if (isParts) {
|
||||||
segments.push(InstanceRenderManager({ imex: "ImexPartsManagement", rome: "RomePartsManagement" }));
|
segments.push(InstanceRenderManager({ imex: "ImexPartsManagement", rome: "RomePartsManagement" }));
|
||||||
}
|
}
|
||||||
|
|
||||||
window.$crisp.push(["set", "session:segments", [segments]]);
|
window.$crisp.push(["set", "session:segments", [segments]]);
|
||||||
|
|
||||||
// Hide/show Crisp chat based on parts mode or features
|
// 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({
|
InstanceRenderManager({
|
||||||
executeFunction: true,
|
executeFunction: true,
|
||||||
@@ -403,7 +403,7 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Set whether it is for parts management only
|
// Set whether it is for parts management only
|
||||||
yield put(setPartsManagementOnly(isParts || payload.features.partsManagementOnly));
|
yield put(setPartsManagementOnly(payload.features.partsManagementOnly));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn("Couldnt find $crisp.", error.message);
|
console.warn("Couldnt find $crisp.", error.message);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user