Quick fix - don't display the onboarding instructions on every task page - and we should clean up the routes.

This commit is contained in:
danfunk 2023-08-14 16:31:28 -04:00
parent 634f35d385
commit dff2d56e56
1 changed files with 6 additions and 0 deletions

View File

@ -1,11 +1,13 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import MDEditor from '@uiw/react-md-editor'; import MDEditor from '@uiw/react-md-editor';
import { useLocation } from 'react-router-dom';
import HttpService from '../services/HttpService'; import HttpService from '../services/HttpService';
import { Onboarding } from '../interfaces'; import { Onboarding } from '../interfaces';
import { objectIsEmpty } from '../helpers'; import { objectIsEmpty } from '../helpers';
export default function OnboardingView() { export default function OnboardingView() {
const [onboarding, setOnboarding] = useState<Onboarding | null>(null); const [onboarding, setOnboarding] = useState<Onboarding | null>(null);
const location = useLocation();
// const navigate = useNavigate(); // const navigate = useNavigate();
@ -17,6 +19,10 @@ export default function OnboardingView() {
}, [setOnboarding]); }, [setOnboarding]);
const onboardingElement = () => { const onboardingElement = () => {
if (location.pathname.match(/^\/tasks\/\d+\/\b/)) {
return null;
}
if ( if (
onboarding && onboarding &&
!objectIsEmpty(onboarding) && !objectIsEmpty(onboarding) &&