Skip to content

Commit

Permalink
vuestorefront#2810 add check to helper if we are on server side and r…
Browse files Browse the repository at this point in the history
…eturn true as default
  • Loading branch information
Benjamin Klein committed May 24, 2019
1 parent 9364eb6 commit e4d7b2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,13 @@ export const processURLAddress = (url: string = '') => {
}

export function bottomVisible () {
if (isServer) {
return true
}
const scrollY = window.scrollY
const visible = window.innerHeight
const pageHeight = document.documentElement.scrollHeight
const bottomOfPage = visible + scrollY >= pageHeight

return bottomOfPage || pageHeight < visible
}

0 comments on commit e4d7b2e

Please sign in to comment.