forked from ryanmwangi/CalMerger
finish setting refresh interval on client side
This commit is contained in:
parent
3f00b5558b
commit
5681530a27
11
script.js
11
script.js
|
@ -41,4 +41,15 @@ const form = document.getElementById('merge-form');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const refreshInterval = 60 * 60 * 1000; // 1 hour
|
const refreshInterval = 60 * 60 * 1000; // 1 hour
|
||||||
|
setInterval(() => {
|
||||||
|
fetch('/merge')
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
result.innerHTML = `Merged calendar URL: <a href="${data.url}">${data.url}</a>`;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(error);
|
||||||
|
result.innerHTML = 'Error merging calendars';
|
||||||
|
});
|
||||||
|
}, refreshInterval);
|
||||||
|
|
Loading…
Reference in New Issue