Skip to content

Commit

Permalink
fix(ui): change current slideshow item, after the animation
Browse files Browse the repository at this point in the history
  • Loading branch information
RouHim committed Sep 18, 2023
1 parent 77ca8de commit e024902
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web-app/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ function getCurrentTemperatureDataFromHomeAssistant() {
* @param resource_id the id of the resource
*/
function setImage(resource_id) {
current_resource_id = resource_id;

// build the image url
let imageUrl = `/api/resources/${resource_id}/${window.screen.availWidth}/${window.screen.availHeight}`;

Expand Down Expand Up @@ -248,6 +246,9 @@ function setImage(resource_id) {
photoMetadataRequest.open("GET", "/api/resources/" + resource_id + "/description");
photoMetadataRequest.send();
photoMetadataRequest.onload = () => slideShowMetadata.innerText = photoMetadataRequest.response;

// At last, set the current resource id
current_resource_id = resource_id;
})
}

Expand Down

0 comments on commit e024902

Please sign in to comment.