Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Olek97 committed Jul 9, 2024
1 parent 6de16f8 commit dc730a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sheets/data.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const config = {
cacheKey: 'zcashDataCache',
cacheTimeout: 2 * 60 * 1000,
cacheTimeout: 3 * 60 * 1000,
api: [
"https://api.coingecko.com/api/v3/simple/price?ids=zcash&vs_currencies=usd&include_market_cap=false&include_24hr_vol=false&include_24hr_change=true&include_last_updated_at=false&precision=5&c",
"https://api.blockchair.com/zcash/stats",
Expand Down Expand Up @@ -78,11 +78,11 @@ async function updateData() {
document.getElementById('txt-total-supply').innerHTML = Math.floor(totalSupply).toLocaleString("en-US") + " ZEC";

// Timer
setInterval(() => {
timerInterval = setInterval(() => {
const now = Date.now();
const distance = countDownDate - now;
if (distance < 0) {
clearInterval(interval);
if (distance < 1) {
clearInterval(timerInterval);
alert("Happy halving! To the mooooooooooooooooooooooooooooooooooooooon.");
return;
}
Expand All @@ -100,6 +100,6 @@ async function updateData() {
document.querySelector('#progress-label').innerHTML = progressPercent.toFixed(2) + '%';
} catch (error) {
console.error("Error in fetching data:", error);
alert("Error in fetching data. Try again later");
alert("Error in fetching data. Try again later.");
}
})();

0 comments on commit dc730a5

Please sign in to comment.