You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wondering if possible to return error on picker:error if the retrieveAccessToken throw error. For example, if the user did not select any account when pop up window appeared, which caused [Error] Unhandled Promise Rejection: Error: Popup window closed (anonymous function) (@googleworkspace_drive-picker-element.js:91:172)
I assume adding catch and dispatch to picker:error to say no access token?
// OAuth token is required either as an attribute or from the OAuth flow using the client ID and scope
const oauthToken =
this.getAttribute("oauth-token") ??
(await retrieveAccessToken(
// biome-ignore lint/style/noNonNullAssertion: just let the error bubble up when null
this.getAttribute("client-id")!,
this.getAttribute("scope") ??
"https://www.googleapis.com/auth/drive.file",
).then((token) => {
this.dispatchEvent(
new CustomEvent("picker:authenticated", { detail: { token } }),
);
return token;
}));
At the moment, using this on Svelte, with a button state to toggle component, but if the popup window closed without account selection, no callback to reset the button state.
The text was updated successfully, but these errors were encountered:
Hello!
Just wondering if possible to return error on
picker:error
if theretrieveAccessToken
throw error. For example, if the user did not select any account when pop up window appeared, which caused[Error] Unhandled Promise Rejection: Error: Popup window closed (anonymous function) (@googleworkspace_drive-picker-element.js:91:172)
I assume adding
catch
and dispatch topicker:error
to say no access token?At the moment, using this on Svelte, with a button state to toggle component, but if the popup window closed without account selection, no callback to reset the button state.
The text was updated successfully, but these errors were encountered: