Skip to content

Commit

Permalink
Fix spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
smattingly committed Aug 15, 2021
1 parent d81f9f5 commit 8751c1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions views/pages/visit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,18 @@ <h1>Visits</h1>
};

const loadVisits = async (page, limit) => {
document.getElementById("loading").style.display = "block";
setTimeout(async () => {
try {
if (hasMoreVisits(page, limit, total)) {
const response = await getVisits(page, limit);
showVisits(response.data);
total = response.total;
} else {
document.getElementById("loading").style.display = "none";
}
} catch (error) {
console.log(error.message);
} finally {
document.getElementById("loading").style.display = "none";
}
}, 500);
};
Expand Down

0 comments on commit 8751c1f

Please sign in to comment.