Closed Quackaholic-Quacktivity closed 1 year ago
currently having some problems with yarn, thus I'm not able to check it , but I hope I can solve it.
I'd expect this more concise snippet to work, but there seems to be a missing sign somewhere:
async function getNextMeetupDate () {
const meetupLocations = await api.rpc.encointer.getLocations(cid);
const tempLocation = locationFromJson(api, meetupLocations[0]);
const tempTime = await getNextMeetupTime(api, tempLocation);
const localtime = timespace.getFuzzyLocalTimeFromPoint(tempTime.toNumber(), [meetupLocations[0].lon, meetupLocations[0].lat]);
debug && console.log('the date is: ' + localtime + meetupLocations[0]);
setNextMeetupTime(localtime.toString());
}
@clangenb If you see the root cause right away, it would be nice to get over it. If not, it can wait
Yeah, the same locationFromJson
was the root cause in the app too - the negative sign is gone. I think stringToLocation
is the culprit. I would have a potential quick fix, but I don't have time today.
Changing it to this function fixes it, I tested it locally, the meetup time is now: 19.03.2023, 18:17:03
export function locationFromJson (api, location) {
return api.createType('Location', {
lat: stringToDegree(location.lat),
lon: stringToDegree(location.lon)
});
}
closes #88