Skip to content

Commit

Permalink
Adding an async flag per Google's recommendation (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai authored Nov 11, 2024
1 parent e9a6baf commit c18f1cb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function togglePrefillableFieldsHiddenState(component) {
async function loadGoogleMapsAPI(callback) {
const script = document.createElement('script');
const apiKey = await getSecret(`${getEventServiceEnv()}-google-places-api`);
script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places&callback=onGoogleMapsApiLoaded`;
script.src = `https://maps.googleapis.com/maps/api/js?loading=async&key=${apiKey}&libraries=places&callback=onGoogleMapsApiLoaded`;
script.async = true;
script.defer = true;
window.onGoogleMapsApiLoaded = callback;
Expand Down

0 comments on commit c18f1cb

Please sign in to comment.