Skip to content

Commit

Permalink
patch: route
Browse files Browse the repository at this point in the history
  • Loading branch information
PrinceBaghel258025 committed Sep 21, 2024
1 parent 48babc5 commit 1582ad0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/chatcard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ type Props = {
org_slug: string;
priority: boolean;
type: string;
isHome?: boolean;
};

const Chatcard = ({ chat, uid, org_id, org_slug, priority, type }: Props) => {
const Chatcard = ({
chat,
uid,
org_id,
org_slug,
priority,
type,
isHome = false,
}: Props) => {
const queryClient = useQueryClient();
const [showLoading, setShowLoading] = useState(false);
const [isGeneratingImage, setIsGeneratingImage] = useState(false);
Expand Down Expand Up @@ -183,7 +192,9 @@ const Chatcard = ({ chat, uid, org_id, org_slug, priority, type }: Props) => {
<Link
onClick={() => setShowLoading(true)}
href={{
pathname: `/chat/${chat.id}`,
pathname: isHome
? `/dashboard/chat/${chat.id}`
: `/chat/${chat.id}`,
}}
key={chat.id}
className={cn(
Expand Down
1 change: 1 addition & 0 deletions src/components/chatcardwrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const ChatCardWrapper = ({
ref={allCards.length - 1 === i ? ref : null}
>
<Chatcard
isHome={isHome}
type={chat.type}
priority={i < 4}
chat={chat}
Expand Down

0 comments on commit 1582ad0

Please sign in to comment.