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:
parent
753fa93886
commit
b24c3a28ac
@ -68,13 +68,13 @@ export default class AppProvider extends PureComponent {
|
|||||||
//
|
//
|
||||||
darkMode() {
|
darkMode() {
|
||||||
const now = new Date().getHours()
|
const now = new Date().getHours()
|
||||||
|
const { location } = this.state
|
||||||
// fallback times, in hours
|
// fallback times, in hours
|
||||||
let sunrise = 7
|
let sunrise = 7
|
||||||
let sunset = 19
|
let sunset = 19
|
||||||
|
|
||||||
// times based on detected country code
|
// 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 country = this.state.location.toLowerCase()
|
||||||
const times = SunCalc.getTimes(
|
const times = SunCalc.getTimes(
|
||||||
new Date(),
|
new Date(),
|
||||||
|
Loading…
Reference in New Issue
Block a user