Skip to content

Commit

Permalink
[mtnclock] Fix widgets disappearing on weather update
Browse files Browse the repository at this point in the history
  • Loading branch information
gloriousDan committed Sep 24, 2024
1 parent f908f56 commit 1357710
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/mtnclock/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
0.02: Get weather from weather.json
0.03: Address unexpected undefined when reading weather.json
0.04: Adding settings and the ability to show the widgets bar
0.05: Fix the widgets disappearing on weather update
2 changes: 2 additions & 0 deletions apps/mtnclock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ function readWeather() {
// save updated weather data if available and it has been an hour since last updated
if (weatherJson && weatherJson.weather && weatherJson.weather.time && (data.time === undefined || (data.time + 3600000) < weatherJson.weather.time)) {
data = {
showWidgets: data.showWidgets,
time: weatherJson.weather.time,
temp: weatherJson.weather.temp,
code: weatherJson.weather.code
Expand All @@ -344,6 +345,7 @@ const _GB = global.GB;
global.GB = (event) => {
if (event.t==="weather") {
data = {
showWidgets: data.showWidgets,
temp: event.temp,
code: event.code,
time: Date.now()
Expand Down
4 changes: 2 additions & 2 deletions apps/mtnclock/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "mtnclock",
"name": "Mountain Pass Clock",
"shortName": "Mtn Clock",
"version": "0.04",
"version": "0.05",
"description": "A clock that changes scenery based on time and weather.",
"readme":"README.md",
"icon": "app.png",
Expand All @@ -23,4 +23,4 @@
{"name":"mtnclock.img","url":"app-icon.js","evaluate":true}
],
"data": [{"name":"mtnclock.json"}]
}
}

0 comments on commit 1357710

Please sign in to comment.