From da75718ea352380318c564384b1fe58019db337e Mon Sep 17 00:00:00 2001 From: ririxi Date: Tue, 26 Mar 2024 22:21:48 +0100 Subject: [PATCH] fix(components): add necessary elements for `1.2.34` (#709) --- src/components/Grid.tsx | 4 ++-- src/components/TabBar.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Grid.tsx b/src/components/Grid.tsx index 41baf84d..f9e93c8b 100644 --- a/src/components/Grid.tsx +++ b/src/components/Grid.tsx @@ -498,7 +498,7 @@ class Grid extends React.Component< this.gridUpdateTabs = this.updateTabs.bind(this); this.gridUpdatePostsVisual = this.updatePostsVisual.bind(this); - const viewPort = document.querySelector(".os-viewport"); + const viewPort = document.querySelector(".os-viewport") ?? document.querySelector("#main .main-view-container__scroll-node"); this.checkScroll = this.isScrolledBottom.bind(this); if (viewPort) { viewPort.addEventListener("scroll", this.checkScroll); @@ -522,7 +522,7 @@ class Grid extends React.Component< */ componentWillUnmount(): void { this.gridUpdateTabs = this.gridUpdatePostsVisual = null; - const viewPort = document.querySelector(".os-viewport"); + const viewPort = document.querySelector(".os-viewport") ?? document.querySelector("#main .main-view-container__scroll-node"); if (viewPort) { this.lastScroll = viewPort.scrollTop; viewPort.removeEventListener("scroll", this.checkScroll); diff --git a/src/components/TabBar.tsx b/src/components/TabBar.tsx index b25a33b0..8730a282 100644 --- a/src/components/TabBar.tsx +++ b/src/components/TabBar.tsx @@ -71,7 +71,7 @@ export const TopBarContent = (props: { activeLink: string; switchCallback: (option: Option) => void; }) => { - const resizeHost = document.querySelector(".Root__main-view .os-resize-observer-host"); + const resizeHost = document.querySelector(".Root__main-view .os-resize-observer-host") ?? document.querySelector(".Root__main-view .os-size-observer"); if (!resizeHost) return null; const [windowSize, setWindowSize] = useState(resizeHost.clientWidth);