Skip to content

Commit 9435844

Browse files
committed
TCA-1279 - show loading spinner before redirect
1 parent 7e933f3 commit 9435844

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src-ts/tools/learn/tca-certificate/user-certification-view/UserCertificationViewBase.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface UserCertificationViewBaseProps {
3636

3737
const UserCertificationViewBase: FC<UserCertificationViewBaseProps> = (props: UserCertificationViewBaseProps) => {
3838
const [queryParams]: [URLSearchParams, any] = useSearchParams()
39-
const wrapElRef: MutableRefObject<HTMLElement | any> = useRef()
39+
const elRef: MutableRefObject<HTMLElement | any> = useRef()
4040

4141
const tcaCertificationPath: string = getTCACertificationPath(`${props.certification?.dashedName}`)
4242
const certificateElRef: MutableRefObject<HTMLDivElement | any> = useRef()
@@ -59,7 +59,7 @@ const UserCertificationViewBase: FC<UserCertificationViewBaseProps> = (props: Us
5959
}, [props.enrollment])
6060

6161
useLayoutEffect(() => {
62-
const el: HTMLElement = wrapElRef.current
62+
const el: HTMLElement = elRef.current
6363
if (!el || !isModalView) {
6464
return
6565
}
@@ -72,7 +72,7 @@ const UserCertificationViewBase: FC<UserCertificationViewBaseProps> = (props: Us
7272
<PageTitle>
7373
{`${!!props.enrollment && `${props.enrollment.userName}'s `}${props.certification?.title} Certificate`}
7474
</PageTitle>
75-
<LoadingSpinner hide={props.enrollmentError || (props.profile && !!props.enrollment)} />
75+
<LoadingSpinner hide={props.enrollmentError || (props.profile && !!props.enrollment)} ref={elRef} />
7676

7777
{props.enrollmentError && (
7878
<CertificatePageLayout
@@ -86,7 +86,7 @@ const UserCertificationViewBase: FC<UserCertificationViewBaseProps> = (props: Us
8686
</CertificatePageLayout>
8787
)}
8888

89-
<div className='full-height-frame' ref={wrapElRef}>
89+
<div className='full-height-frame' ref={elRef}>
9090
{props.profile && props.certification && props.enrollment && (
9191
<HiringManagerView
9292
certification={props.certification}

src-ts/tools/learn/tca-certificate/user-certification-view/UuidCertificationView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ const UuidCertificationView: FC<{}> = () => {
4848
}
4949

5050
hideSiblings(el.parentElement as HTMLElement)
51-
}, [isModalView])
51+
})
5252

5353
return (
5454
<>
55-
<LoadingSpinner hide={enrollmentReady} ref={elRef} />
55+
<LoadingSpinner hide={enrollmentError} ref={elRef} />
5656
{enrollmentReady && enrollmentError && (
5757
<UserCertificationViewBase
5858
enrollment={enrollment}

0 commit comments

Comments
 (0)