diff --git a/src/components/Sidebar/Sidebar.jsx b/src/components/Sidebar/Sidebar.jsx index bc968216..b3f46191 100644 --- a/src/components/Sidebar/Sidebar.jsx +++ b/src/components/Sidebar/Sidebar.jsx @@ -60,18 +60,14 @@ export const Sidebar = ({ const hideRightDrawer = rightDrawer?.count <= 0 || !rightDrawer; const handleOnClose = (direction, closeDrawer) => { - if (direction === "left") { - if (closeDrawer) { + if (closeDrawer) { + if (direction === "left") { setIsLeftDrawerOpen(false); - } - - leftDrawer.onClose?.(); - } else { - if (closeDrawer) { + leftDrawer.onClose?.(); + } else { setIsRightDrawerOpen(false); + rightDrawer.onClose?.(); } - - rightDrawer.onClose?.(); } };