Skip to content

Commit

Permalink
fix(components): add necessary elements for 1.2.34 (#709)
Browse files Browse the repository at this point in the history
  • Loading branch information
rxri authored Mar 26, 2024
1 parent ca83977 commit da75718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/components/TabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit da75718

Please sign in to comment.