Skip to content

Commit

Permalink
fix(dashboard): Detect workflow test page with useMatch
Browse files Browse the repository at this point in the history
  • Loading branch information
rifont committed Nov 28, 2024
1 parent 1a7781b commit b5acbed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/dashboard/src/hooks/use-test-page.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useLocation } from 'react-router-dom';
import { ROUTES } from '@/utils/routes';
import { useMatch } from 'react-router-dom';

export const useTestPage = () => {
const { pathname } = useLocation();
const match = useMatch(ROUTES.TEST_WORKFLOW);

return {
isTestPage: pathname.includes('/test'),
isTestPage: match !== null,
};
};

0 comments on commit b5acbed

Please sign in to comment.