Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63827ef

Browse files
committed
fix: get activeOrg
1 parent ca4d203 commit 63827ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

site/src/pages/TemplatesPage/MultiOrgTemplatePage/TemplatesPageView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Interpolation, Theme } from "@emotion/react";
22
import type { FC } from "react";
3-
import { Link, useNavigate, useSearchParams } from "react-router-dom";
3+
import { Link, useNavigate } from "react-router-dom";
44
import type { Template, TemplateExample } from "api/typesGenerated";
55
import { ErrorAlert } from "components/Alert/ErrorAlert";
66
import {
@@ -85,7 +85,8 @@ export const TemplatesPageView: FC<TemplatesPageViewProps> = ({
8585
}) => {
8686
const navigate = useNavigate();
8787
const isEmpty = templates && templates.length === 0;
88-
const activeOrg = query?.split(":")[1] ?? "all";
88+
const q = query?.split(":") || [];
89+
const activeOrg = q[0] === "organization" ? query?.split(":")[1] : "all";
8990
const templatesByOrg = getTemplatesByOrg(templates ?? []);
9091

9192
return (

0 commit comments

Comments
 (0)