Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update group-header.tsx

Steven Teye13a48fcac12
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/group-header.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/group-header.tsx
index fe5c219269..af0dd7ca75 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/group-header.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/group-header.tsx
@@ -18,20 +18,20 @@ import {
} from "@dub/ui";
import { cn, PARTNERS_DOMAIN } from "@dub/utils";
import Link from "next/link";
-import { useParams, usePathname } from "next/navigation";
-
-// TODO:
-// Handle error when the group doesn't exists
+import { redirect, useParams, usePathname } from "next/navigation";
export function GroupHeaderTitle() {
- const { program } = useProgram();
const { group, loading } = useGroup();
const { slug: workspaceSlug } = useWorkspace();
- if (loading || !group || !program) {
+ if (loading) {
return <div className="h-7 w-32 animate-pulse rounded-md bg-neutral-200" />;
}
+ if (!group) {
+ redirect(`/${workspaceSlug}/program/groups`);
+ }
+
return (
<div className="flex items-center gap-1.5">
<Link