properly read units from local storage on startup
This commit is contained in:
parent
037499dfb1
commit
88a17587b3
|
@ -127,8 +127,10 @@ const index = (() => {
|
||||||
const TwcUnits = localStorage.getItem('TwcUnits');
|
const TwcUnits = localStorage.getItem('TwcUnits');
|
||||||
if (!TwcUnits || TwcUnits === 'ENGLISH') {
|
if (!TwcUnits || TwcUnits === 'ENGLISH') {
|
||||||
document.getElementById('radEnglish').checked = true;
|
document.getElementById('radEnglish').checked = true;
|
||||||
|
navigation.message({ type: 'units', message: 'english' });
|
||||||
} else if (TwcUnits === 'METRIC') {
|
} else if (TwcUnits === 'METRIC') {
|
||||||
document.getElementById('radMetric').checked = true;
|
document.getElementById('radMetric').checked = true;
|
||||||
|
navigation.message({ type: 'units', message: 'metric' });
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('radEnglish').addEventListener('change', changeUnits);
|
document.getElementById('radEnglish').addEventListener('change', changeUnits);
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
<div id="hourly-html" class="weather-display">
|
<div id="hourly-html" class="weather-display">
|
||||||
<%- include('partials/hourly.ejs') %>
|
<%- include('partials/hourly.ejs') %>
|
||||||
</div>
|
</div>
|
||||||
<div id="current-weather-html" class="weather-display show">
|
<div id="current-weather-html" class="weather-display">
|
||||||
<%- include('partials/current-weather.ejs') %>
|
<%- include('partials/current-weather.ejs') %>
|
||||||
</div>
|
</div>
|
||||||
<div id="local-forecast-html" class="weather-display">
|
<div id="local-forecast-html" class="weather-display">
|
||||||
|
|
Loading…
Reference in a new issue