properly read units from local storage on startup

This commit is contained in:
Matt Walsh 2022-08-04 13:59:21 -05:00
parent 037499dfb1
commit 88a17587b3
2 changed files with 3 additions and 1 deletions

View file

@ -127,8 +127,10 @@ const index = (() => {
const TwcUnits = localStorage.getItem('TwcUnits');
if (!TwcUnits || TwcUnits === 'ENGLISH') {
document.getElementById('radEnglish').checked = true;
navigation.message({ type: 'units', message: 'english' });
} else if (TwcUnits === 'METRIC') {
document.getElementById('radMetric').checked = true;
navigation.message({ type: 'units', message: 'metric' });
}
document.getElementById('radEnglish').addEventListener('change', changeUnits);

View file

@ -93,7 +93,7 @@
<div id="hourly-html" class="weather-display">
<%- include('partials/hourly.ejs') %>
</div>
<div id="current-weather-html" class="weather-display show">
<div id="current-weather-html" class="weather-display">
<%- include('partials/current-weather.ejs') %>
</div>
<div id="local-forecast-html" class="weather-display">