Skip to content

Commit da75718

Browse files
authored
fix(components): add necessary elements for 1.2.34 (#709)
1 parent ca83977 commit da75718

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/Grid.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ class Grid extends React.Component<
498498
this.gridUpdateTabs = this.updateTabs.bind(this);
499499
this.gridUpdatePostsVisual = this.updatePostsVisual.bind(this);
500500

501-
const viewPort = document.querySelector(".os-viewport");
501+
const viewPort = document.querySelector(".os-viewport") ?? document.querySelector("#main .main-view-container__scroll-node");
502502
this.checkScroll = this.isScrolledBottom.bind(this);
503503
if (viewPort) {
504504
viewPort.addEventListener("scroll", this.checkScroll);
@@ -522,7 +522,7 @@ class Grid extends React.Component<
522522
*/
523523
componentWillUnmount(): void {
524524
this.gridUpdateTabs = this.gridUpdatePostsVisual = null;
525-
const viewPort = document.querySelector(".os-viewport");
525+
const viewPort = document.querySelector(".os-viewport") ?? document.querySelector("#main .main-view-container__scroll-node");
526526
if (viewPort) {
527527
this.lastScroll = viewPort.scrollTop;
528528
viewPort.removeEventListener("scroll", this.checkScroll);

src/components/TabBar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const TopBarContent = (props: {
7171
activeLink: string;
7272
switchCallback: (option: Option) => void;
7373
}) => {
74-
const resizeHost = document.querySelector(".Root__main-view .os-resize-observer-host");
74+
const resizeHost = document.querySelector(".Root__main-view .os-resize-observer-host") ?? document.querySelector(".Root__main-view .os-size-observer");
7575
if (!resizeHost) return null;
7676

7777
const [windowSize, setWindowSize] = useState(resizeHost.clientWidth);

0 commit comments

Comments
 (0)