Skip to content

Commit

Permalink
SW-5837 Add leading slash to separate query params from path (#3301)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexTerraformation authored Oct 28, 2024
1 parent a9aa685 commit cf222c6
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 118 deletions.
4 changes: 2 additions & 2 deletions src/components/KnowledgeBaseLink/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import strings from 'src/strings';
export default function KnowledgeBaseLink(): JSX.Element {
const theme = useTheme();
const knowledgeBaseLinks = useKnowledgeBaseLinks();
const [currentLink, setCurrentLink] = useState(knowledgeBaseLinks.home);
const [currentLink, setCurrentLink] = useState(knowledgeBaseLinks['/home']);
const location = useLocation();

const onClick = () => {
window.open(currentLink, '_blank');
};

useEffect(() => {
setCurrentLink(knowledgeBaseLinks.home);
setCurrentLink(knowledgeBaseLinks['/home']);
for (const key in knowledgeBaseLinks) {
if ((location.pathname + location.search).match(key)) {
setCurrentLink(knowledgeBaseLinks[key as keyof typeof KnowledgeBaseLink]);
Expand Down
Loading

0 comments on commit cf222c6

Please sign in to comment.