Skip to content

Commit

Permalink
[FIX] Omnichannel business hours page breaking navigation (#23595)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Aman-Maheshwari and tiagoevanp authored Nov 12, 2021
1 parent e150668 commit 687e17a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/views/omnichannel/businessHours/BusinessHoursRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 687e17a

Please sign in to comment.