[FIX] Omnichannel business hours page breaking navigation (#23595)

* fix business hour persisting UI

* eslint

* improvement

* Update BusinessHoursRouter.js

* Update EditBusinessHoursPage.js

* remove useState

Co-authored-by: Tiago Evangelista Pinto <tiago.evangelista@rocket.chat>
pull/23499/head^2
Aman-Maheshwari 4 years ago committed by GitHub
parent e150668e1b
commit 687e17a6ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      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 ? <EditBusinessHoursPage type={type} id={id} /> : null;
}

Loading…
Cancel
Save