Skip to content

Commit

Permalink
fix(startup): screens mixed up in some conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Dec 8, 2024
1 parent 3c9a449 commit 662f04e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/features/app_start/shared/hooks/useFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const useFeedback = () => {
document.querySelector<HTMLElement>('#onboarding-error');

const hideMessage = () => {
onboardingError.style.animation = 'fade-out 0.15s forwards';
if (onboardingError) {
onboardingError.style.animation = 'fade-out 0.15s forwards';
}
};

const showMessage = () => {
Expand Down
26 changes: 19 additions & 7 deletions src/features/app_start/vip/startup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,25 @@ const VipStartup = () => {
{!isCongCreate && !isEncryptionCodeOpen && isLoading && (
<WaitingLoader type="lottie" variant="standard" />
)}
{isUserSignIn && <Signin />}
{isUserMfaVerify && <VerifyMFA />}
{isUserAccountCreated && <UserAccountCreated />}
{isCongCreate && <CongregationCreate />}
{isEmailAuth && <EmailAuth />}
{isEmailLinkAuth && <EmailLinkAuthentication />}
{isEncryptionCodeOpen && <CongregationEncryption />}

{!isLoading && (
<>
{isUserSignIn && <Signin />}

{!isUserSignIn && (
<>
{isUserMfaVerify && <VerifyMFA />}
{isUserAccountCreated && <UserAccountCreated />}
{isCongCreate && <CongregationCreate />}
{isEmailAuth && <EmailAuth />}
{isEmailLinkAuth && <EmailLinkAuthentication />}
{!isCongCreate && isEncryptionCodeOpen && (
<CongregationEncryption />
)}
</>
)}
</>
)}
</>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/features/app_start/vip/startup/useStartup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const useStartup = () => {
return;
}

if (congAccessCode.length === 0) {
if (congAccessCode.length === 0 && congName.length > 0) {
setIsStart(false);
setIsEncryptionCodeOpen(true);
}
Expand Down

0 comments on commit 662f04e

Please sign in to comment.