mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-23 03:59:30 -07:00
properly read units from local storage on startup
This commit is contained in:
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user