diff --git a/client/src/utils/solution-display-type.ts b/client/src/utils/solution-display-type.ts index b28c7b9780e..c15c123e56c 100644 --- a/client/src/utils/solution-display-type.ts +++ b/client/src/utils/solution-display-type.ts @@ -1,6 +1,6 @@ import type { CompletedChallenge } from '../redux/prop-types'; import { challengeTypes } from '../../../shared/config/challenge-types'; -import { maybeUrlRE } from '.'; +import { hasProtocolRE } from '.'; type DisplayType = | 'none' @@ -26,7 +26,7 @@ export const getSolutionDisplayType = ({ if (!solution) return 'none'; // Some of the user records still have JavaScript project solutions stored as // solution strings - if (!maybeUrlRE.test(solution)) return 'showUserCode'; - if (maybeUrlRE.test(githubLink ?? '')) return 'showProjectAndGithubLinks'; + if (!hasProtocolRE.test(solution)) return 'showUserCode'; + if (hasProtocolRE.test(githubLink ?? '')) return 'showProjectAndGithubLinks'; return 'showProjectLink'; };