Need to bubble async/await to the top level function as well in the handlebar views, otherwise there can also be transient issues in the setInterval if the if block evaluates to true and tries to refresh variables that haven't been initialised yet.
Tested this locally by replacing the statement in the if block to if (true), e.g. in index.handlebars:
await initialize(); // <-- gotta make sure this is initialised before using it in the setInterval below
setInterval(
async () => {
if(true) // <-- set this to true to test the await works
{
flights = await refreshFlights(filterName, filterCriteria);
await refreshATC();
updateInfobar();
setLayerOrder();
}
else
{
interpolateLoc();
}
}, 1000);
Need to bubble
async/await
to the top level function as well in the handlebar views, otherwise there can also be transient issues in thesetInterval
if theif
block evaluates to true and tries to refresh variables that haven't been initialised yet.Tested this locally by replacing the statement in the
if
block toif (true)
, e.g. inindex.handlebars
: