Skip to content

Commit

Permalink
Fix style usage (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
dorsha authored Nov 13, 2024
1 parent fa32be3 commit db231fa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ const App = () => {
let ssoAppId = urlParams.get('sso_app_id') || '';
ssoAppId = ssoAppRegex.exec(ssoAppId)?.[0] || '';

const ref = React.useRef<HTMLElement>();

React.useEffect(() => {
const updateFavicon = async () => {
if (faviconUrl && ssoAppId && projectId) {
Expand Down Expand Up @@ -152,6 +154,16 @@ const App = () => {
'descope-login-container': !isWideContainer
});

// this is a workaround only for the dynamic sdk, should not be used in other places
const internalId = setInterval(() => {
if (!ref.current) {
ref.current = document.querySelector('descope-wc') as any;
} else {
clearInterval(internalId);
ref.current.setAttribute('style-id', styleId!);
}
}, 50);

const flowProps = {
flowId,
debug,
Expand Down

0 comments on commit db231fa

Please sign in to comment.