fix scroll

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-08-16 17:53:00 +02:00
parent d6fba3ad13
commit 6ea766d93b
2 changed files with 3 additions and 2 deletions

View file

@ -243,7 +243,7 @@ const DropdownMenu = (props: IDropdownMenu) => {
history.push(pathname, { ...(state as any), soapboxDropdownKey: dropdownHistoryKey.current });
unlistenHistory.current = history.listen(({ state }, action) => {
if (!(state as any)?.soapboxModalKey) {
if (!(state as any)?.soapboxDropdownKey) {
handleClose();
} else if (action === 'POP') {
handleClose(false);

View file

@ -38,7 +38,8 @@ const SoapboxMount = () => {
// @ts-ignore: I don't actually know what these should be, lol
const shouldUpdateScroll = (prevRouterProps, { location }) =>
!(location.state?.soapboxModalKey && location.state?.soapboxModalKey !== prevRouterProps?.location?.state?.soapboxModalKey);
!(location.state?.soapboxModalKey && location.state?.soapboxModalKey !== prevRouterProps?.location?.state?.soapboxModalKey)
&& !(location.state?.soapboxDropdownKey && location.state?.soapboxDropdownKey !== prevRouterProps?.location?.state?.soapboxDropdownKey);
return (
<SiteErrorBoundary>