Skip to content

Commit

Permalink
fix: window
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjoeio committed May 31, 2020
1 parent 23afa80 commit 231cb82
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ const Hero = () => {
const theme = useTheme()
const date = new Date()

fetch('/.netlify/functions/page-views')
.then(response => response.json())
.then(console.log)
if (typeof window === 'undefined') {
fetch('/.netlify/functions/page-views')
.then(response => response.json())
.then(console.log)
}

return (
<section
Expand Down

0 comments on commit 231cb82

Please sign in to comment.