Add loader for google services
All checks were successful
Build Docker image / build (push) Successful in 8m8s
Build Docker image / deploy (push) Successful in 4s
Build Docker image / verify (push) Successful in 30s

This commit is contained in:
Roman Krček
2025-09-08 16:04:50 +02:00
parent e43101648b
commit 68e4d0b77b
2 changed files with 27 additions and 3 deletions

View File

@@ -15,6 +15,7 @@ let gsiInited = false;
export function initGoogleClients(callback: () => void) {
// If everything is already initialized, just run the callback.
if (gapiInited && gsiInited) {
isGoogleApiReady.set(true); // Ensure it's set if called again
callback();
return;
}
@@ -37,7 +38,6 @@ export function initGoogleClients(callback: () => void) {
})
.then(() => {
gapiInited = true;
isGoogleApiReady.set(true);
// Now that GAPI is ready, initialize the GSI client.
initGsiClient(callback);
});
@@ -104,6 +104,7 @@ function initGsiClient(callback: () => void) {
}
}
});
isGoogleApiReady.set(true);
callback();
};
}