From dff470164c18753c08d268bde8de6c9c987d1b45 Mon Sep 17 00:00:00 2001 From: Garry Ing Date: Sun, 9 May 2021 11:54:11 -0400 Subject: [PATCH] lint --- assets/js/scripts.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/assets/js/scripts.js b/assets/js/scripts.js index 82e0dc3..4301f20 100644 --- a/assets/js/scripts.js +++ b/assets/js/scripts.js @@ -144,6 +144,8 @@ if (typeof window.graphDataIndex !== 'undefined') { // Notes graph +const d3 = window.d3 + if (typeof window.graphData !== 'undefined') { const MINIMAL_NODE_SIZE = 10 const MAX_NODE_SIZE = 16 @@ -402,15 +404,15 @@ const capitalize = str => `${str.charAt(0).toUpperCase()}${str.slice(1)}` const conditionsContainer = document.getElementById('gardenConditions') const openWeatherUrl = 'https://garden-weather-api.vercel.app/weather/toronto' -async function fetchWeather() { - let response = await window.fetch(openWeatherUrl) - let weatherData = await response.json() +async function fetchWeather () { + const response = await window.fetch(openWeatherUrl) + const weatherData = await response.json() conditionsContainer.innerHTML = `${capitalize(weatherData.weather[0].description)}, ${Math.round(weatherData.main.temp)}°C` conditionsContainer.classList.remove('dn') } if (conditionsContainer) { fetchWeather().catch(e => { - console.log('There has been a problem with getting the weather ' + e.message); - }); + console.log('There has been a problem with getting the weather ' + e.message) + }) }