Skip to content

Commit

Permalink
fix(window): fix window is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoee committed Jun 16, 2020
1 parent 5f41064 commit 1d57ae7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @returns {Boolean}
*/
function isDarkMode () {
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
return window && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
}

/**
Expand Down

0 comments on commit 1d57ae7

Please sign in to comment.