diff --git a/client/views/omnichannel/businessHours/BusinessHoursRouter.js b/client/views/omnichannel/businessHours/BusinessHoursRouter.js index f895667994eb..c1b788ba4b0d 100644 --- a/client/views/omnichannel/businessHours/BusinessHoursRouter.js +++ b/client/views/omnichannel/businessHours/BusinessHoursRouter.js @@ -21,15 +21,15 @@ const BusinessHoursRouter = () => { const router = useRoute('omnichannel-businessHours'); useEffect(() => { - if (isSingleBH && (context !== 'edit' || type !== 'default')) { + if (isSingleBH) { router.push({ context: 'edit', type: 'default', }); } - }, [context, isSingleBH, router, type]); + }, [isSingleBH, router]); - if ((context === 'edit' && type) || (isSingleBH && (context !== 'edit' || type !== 'default'))) { + if (context === 'edit' || isSingleBH) { return type ? : null; }