mirror of
https://github.com/urbit/shrub.git
synced 2024-12-29 15:14:17 +03:00
parent
44e0f409bb
commit
7588203f45
@ -36,8 +36,9 @@ export default class Tiles extends React.PureComponent {
|
||||
/>
|
||||
);
|
||||
} else if (key === 'clock') {
|
||||
const location = 'nearest-area' in props.weather ? props.weather['nearest-area'][0] : '';
|
||||
return (
|
||||
<ClockTile key={key} location={props.location} />
|
||||
<ClockTile key={key} location={location} />
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -202,10 +202,9 @@ class Clock extends React.PureComponent {
|
||||
}
|
||||
|
||||
initGeolocation() {
|
||||
if (typeof this.props.data === 'string') {
|
||||
const latlon = this.props.data.split(',');
|
||||
const lat = latlon[0];
|
||||
const lon = latlon[1];
|
||||
if (typeof this.props.data === 'object') {
|
||||
|
||||
const { latitude: lat, longitude: lon } = this.props.data;
|
||||
|
||||
const suncalc = SunCalc.getTimes(new Date(), lat, lon);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user