Closed kaycebasques closed 8 years ago
Adding comments to the commits now...
To fix the app.hasRequestPending
issues:
initialWeatherForecast
add created: '2016-07-22T01:00:00Z',
to the object (line ~12)hasRequestPending
from the app
object, (line ~46)var dataLastUpdated = new Date(data.created);
to the top of app.updateForecastCard
var card = app.visibleCards[data.key]
// Verifies the data provide is newer than what's already visible
// on the card, if it's not bail, if it is, continue and update the
// time saved in the card
var cardLastUpdatedElem = card.querySelector('.card-last-updated');
var cardLastUpdated = cardLastUpdatedElem.textContent;
if (cardLastUpdated) {
cardLastUpdated = new Date(cardLastUpdated);
// Bail if the card has more recent data then the data
if (dataLastUpdated.getTime() < cardLastUpdated.getTime()) {
return;
}
}
cardLastUpdatedElem.textContent = data.created;
results.create = json.query.created;
to the caches.match
and XHR
in app.getForecast
<div class="card-last-updated" hidden></div>
to the card template.I'll send you the JS file with my updates.
LGTM! Thanks @kaycebasques!!
cool thanks @petele I'll clean up the code and then merge
I also need to update the rest of the directories...
@marcacohen @petele please review my updates to use the Yahoo Weather API.
So far I've only made the updates in the
final
directory. Once we're all on the same page I'll update the other directories.