diff --git a/scripts/content.js b/scripts/content.js index 5e67275..d51788e 100644 --- a/scripts/content.js +++ b/scripts/content.js @@ -254,11 +254,11 @@ async function getAvailableDates(consulateId) { "accept": "application/json, text/javascript, */*; q=0.01", // "cache-control": "no-cache", }}) - .then(d => d.json()) .catch(async e => { await handleHttpError(e); throw e; }) + .then(d => d.json()) .then(data => { let dateList = data.map(item => item.date); dateList.sort(); @@ -279,12 +279,12 @@ async function filterDates(dates, currentAppt, deltaFromAppt, deltaFromNow) { async function getAvailableTimes(consulateId, date) { let uri = window.location.pathname + `/times/${consulateId}.json?date=${date}&appointments[expedite]=false` - let times = await fetch(uri, { headers: { "x-requested-with": "XMLHttpRequest" } }) - .then(d => d.json()) + let times = fetch(uri, { headers: { "x-requested-with": "XMLHttpRequest" } }) .catch(async e => { await handleHttpError(e); throw e; }) + .then(d => d.json()) .then(data => data.available_times) .catch(e => null); return times;