From c29ecaf14f74be1d819bdc6ee311b9903ed8d78f Mon Sep 17 00:00:00 2001 From: Tom <20648924+moT01@users.noreply.github.com> Date: Thu, 16 Feb 2023 23:56:28 -0600 Subject: [PATCH] fix(client): site crashing when leaving rdb challenge (#49409) fix: crashing when leaving rdb --- client/src/components/layouts/default.tsx | 8 +++++++- client/src/templates/Challenges/codeally/show.tsx | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/components/layouts/default.tsx b/client/src/components/layouts/default.tsx index a86eae022a8..3434a007d05 100644 --- a/client/src/components/layouts/default.tsx +++ b/client/src/components/layouts/default.tsx @@ -25,6 +25,7 @@ import { userSelector, isOnlineSelector, isServerOnlineSelector, + showCodeAllySelector, userFetchStateSelector } from '../../redux/selectors'; @@ -56,6 +57,7 @@ const mapStateToProps = createSelector( isOnlineSelector, isServerOnlineSelector, userFetchStateSelector, + showCodeAllySelector, userSelector, ( isSignedIn, @@ -63,6 +65,7 @@ const mapStateToProps = createSelector( isOnline: boolean, isServerOnline: boolean, fetchState: UserFetchState, + showCodeAlly: boolean, user: User ) => ({ isSignedIn, @@ -72,6 +75,7 @@ const mapStateToProps = createSelector( isServerOnline, fetchState, theme: user.theme, + showCodeAlly, user }) ); @@ -98,6 +102,7 @@ interface DefaultLayoutProps extends StateProps, DispatchProps { showFooter?: boolean; isChallenge?: boolean; block?: string; + showCodeAlly: boolean; superBlock?: string; t: TFunction; } @@ -124,6 +129,7 @@ function DefaultLayout({ superBlock, t, theme = Themes.Default, + showCodeAlly, user, fetchUser, updateAllChallengesInfo @@ -230,7 +236,7 @@ function DefaultLayout({ /> ) : null} - {isChallenge && ( + {isChallenge && !showCodeAlly && (
{ challenge => challenge.id === challengeId ); - const breadcrumbs = document.querySelector('.breadcrumbs-demo'); - showCodeAlly && breadcrumbs?.remove(); - return showCodeAlly ? (