1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-23 01:29:41 +01:00

account for Tor country

This commit is contained in:
Matthias Kretschmann 2018-09-28 19:52:09 +02:00
parent 753fa93886
commit b24c3a28ac
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -68,13 +68,13 @@ export default class AppProvider extends PureComponent {
//
darkMode() {
const now = new Date().getHours()
const { location } = this.state
// fallback times, in hours
let sunrise = 7
let sunset = 19
// times based on detected country code
if (this.state.location && this.state.location !== 'XX') {
if (location && location !== 'XX' && location !== 'T1') {
const country = this.state.location.toLowerCase()
const times = SunCalc.getTimes(
new Date(),