don't fetch data if offline

This commit is contained in:
Thomas Rupprecht 2023-01-21 02:10:50 +01:00
parent ad9abe3c94
commit 82bcdef199
1 changed files with 3 additions and 0 deletions

View File

@ -49,6 +49,9 @@ function fetchSpaceApi() {
}
async function fetchNewData() {
if (!globalThis.navigator.onLine) {
return;
}
try {
const result = await Promise.allSettled([fetchCalendar(), fetchSpaceApi()]);
const calendarJson = result[0].value;