fix: sidebar swipe when target is slider

This commit is contained in:
sk1982 2024-04-02 00:35:07 -04:00
parent 5edabd15df
commit 28ae102c02

View File

@ -77,6 +77,10 @@ export const HeaderSidebar = ({ children }: HeaderSidebarProps) => {
onSwipeStart: e => {
if (e.dir === 'Down' || e.dir === 'Up') return;
const data = (e.event.target as HTMLElement)?.dataset;
if (data?.slot === 'thumb' || data?.dragging)
return;
const allMenusClosed = !isMenuOpen && !isNotificationsOpen;
const xPercent = e.initial[0] / window.innerWidth;
@ -427,7 +431,7 @@ export const HeaderSidebar = ({ children }: HeaderSidebarProps) => {
</Button>
</div>
</div>);
}, [isNotificationsOpen, notificationsTranslate, user, friendRequests]);
}, [isNotificationsOpen, notificationsTranslate, user, friendRequests, notifications, router]);
return (<>
{ leftSidebar }