Skip to content

Commit

Permalink
fixes?
Browse files Browse the repository at this point in the history
  • Loading branch information
leafty committed Jan 3, 2025
1 parent 10857a9 commit d574b7b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function ProjectPageContainer() {
namespace: string | undefined;
slug: string | undefined;
}>();
const { data, isLoading, error } =
const { data, currentData, isLoading, error } =
useGetNamespacesByNamespaceProjectsAndSlugQuery({
namespace: namespace ?? "",
slug: slug ?? "",
Expand All @@ -49,24 +49,24 @@ export default function ProjectPageContainer() {
const navigate = useNavigate();

useEffect(() => {
if (namespace && data && data.namespace !== namespace) {
if (namespace && currentData && currentData.namespace !== namespace) {
navigate(
generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, {
namespace: data.namespace,
slug: data.slug,
namespace: currentData.namespace,
slug: currentData.slug,
}),
{ replace: true }
);
} else if (slug && data && data.slug !== slug) {
} else if (slug && currentData && currentData.slug !== slug) {
navigate(
generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, {
namespace: data.namespace,
slug: data.slug,
namespace: currentData.namespace,
slug: currentData.slug,
}),
{ replace: true }
);
}
}, [data, namespace, navigate, slug]);
}, [currentData, namespace, navigate, slug]);

if (isLoading) return <Loader className="align-self-center" />;

Expand Down
2 changes: 1 addition & 1 deletion client/src/features/groupsV2/show/GroupPageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function GroupPageContainer() {
const navigate = useNavigate();

const {
data: namespace,
currentData: namespace,
isLoading: isLoadingNamespace,
error: namespaceError,
} = useGetNamespacesByNamespaceSlugQuery(
Expand Down
2 changes: 1 addition & 1 deletion client/src/features/usersV2/show/UserShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function UserShow() {
const navigate = useNavigate();

const {
data: namespace,
currentData: namespace,
isLoading: isLoadingNamespace,
error: namespaceError,
} = useGetNamespacesByNamespaceSlugQuery(
Expand Down

0 comments on commit d574b7b

Please sign in to comment.