Skip to content

Commit

Permalink
Fix waypoints crash
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Dec 29, 2022
1 parent da62522 commit 99a1566
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions frontend/src/components/posts-list/waypoint.js
Expand Up @@ -12,14 +12,14 @@ export default class extends React.Component {
componentDidMount() {
if (this.props.post.is_read) return // don't register read tracker

$(this.documentNode).waypoint({
$(this.element).waypoint({
handler: (direction) => {
if (direction !== "down" || this.props.post.is_read) return

// after 1500ms run flag post as read logic
window.setTimeout(() => {
// check if post's bottom edge is still in viewport
const boundingClientRect = this.documentNode.getBoundingClientRect()
const boundingClientRect = this.element.getBoundingClientRect()
const offsetBottom =
boundingClientRect.height + boundingClientRect.top
const clientHeight = document.documentElement.clientHeight
Expand Down Expand Up @@ -58,7 +58,7 @@ export default class extends React.Component {
<div
className={this.props.className}
ref={(node) => {
this.documentNode = node
if (node) this.element = node
}}
>
{this.props.children}
Expand Down
2 changes: 1 addition & 1 deletion misago/static/misago/js/misago.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion misago/static/misago/js/misago.js.map

Large diffs are not rendered by default.

0 comments on commit 99a1566

Please sign in to comment.