Skip to content

Commit

Permalink
Merge pull request #168 from berzniz/fix_not_always_loading
Browse files Browse the repository at this point in the history
Bug fix: tree not always loading on navigation
  • Loading branch information
berzniz authored Aug 27, 2021
2 parents 23ed2cd + 89e8d4e commit af65099
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/js/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ let observer
const observe = () => {
observer && observer.disconnect()
const pjaxContainer = document.querySelector('[data-pjax-container]')
const pjaxContentContainer = document.querySelector('#repo-content-pjax-container')
observer = new MutationObserver(start)
observer.observe(pjaxContainer, { childList: true })
pjaxContainer && observer.observe(pjaxContainer, { childList: true })
pjaxContentContainer && observer.observe(pjaxContentContainer, { childList: true })
}

class Top extends React.Component {
Expand Down

0 comments on commit af65099

Please sign in to comment.