Skip to content

Commit

Permalink
renamed fetchAndUpdateData in main.js to fetchAndUpdateAdData
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Comand committed Oct 9, 2024
1 parent 008a9ca commit 3c1758f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Auto Relese
name: Auto Release

on:
push:
Expand Down
10 changes: 5 additions & 5 deletions static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ document.addEventListener('DOMContentLoaded', function () {
document.getElementById("bottom-right").style.display = "none"
document.getElementById("iframe2").style.height = "100vh"
reloadIframe("iframe2")
fetchAndUpdateData()
fetchAndUpdateAdData()
});
iframeElement.onload = function () {
if (!iframeElement.checkVisibility()) {
Expand All @@ -109,7 +109,7 @@ document.addEventListener('DOMContentLoaded', function () {
document.getElementById("bottom-right").style.display = "none"
document.getElementById("iframe2").style.height = "100vh"
reloadIframe("iframe2")
fetchAndUpdateData()
fetchAndUpdateAdData()
});

function showNextImage() {
Expand Down Expand Up @@ -141,7 +141,7 @@ document.addEventListener('DOMContentLoaded', function () {
}
}

function fetchAndUpdateData() {
function fetchAndUpdateAdData() {
fetch('/ad')
.then(response => response.json())
.then(data => {
Expand Down Expand Up @@ -179,7 +179,7 @@ document.addEventListener('DOMContentLoaded', function () {
clearInterval(adRefetchInterval);
}
// Set a new interval with the updated switching time
adRefetchInterval = setInterval(fetchAndUpdateData, adRefetchTime * 1000);
adRefetchInterval = setInterval(fetchAndUpdateAdData, adRefetchTime * 1000);

})
.catch(error => {
Expand All @@ -188,7 +188,7 @@ document.addEventListener('DOMContentLoaded', function () {
}

// Fetch data initially
fetchAndUpdateData();
fetchAndUpdateAdData();
showNextImage(); // Show the first image immediately
adUpdateInterval = setInterval(showNextImage, adSwitchingTime * 1000);

Expand Down

0 comments on commit 3c1758f

Please sign in to comment.