1
1
mirror of https://github.com/urbit/shrub.git synced 2024-12-29 15:14:17 +03:00

clock: use new weather data

Fixes 
This commit is contained in:
Tyler Brown Cifu Shuster 2020-12-04 13:27:41 -08:00
parent 44e0f409bb
commit 7588203f45
2 changed files with 5 additions and 5 deletions
pkg/interface/src/views/apps/launch/components

View File

@ -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 {

View File

@ -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);