mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
🐛 fix(topic): correct topic item href route for agent and group pages (#11607)
- Change agent topic href from `/chat?agent=xxx&topic=xxx` to `/agent/xxx?topic=xxx` - Change group topic href from `/group/xxx?topic=xxx` format using urlJoin to direct template literal - Remove unused urlJoin import 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,6 @@ import { cssVar } from 'antd-style';
|
||||
import { MessageSquareDashed, Star } from 'lucide-react';
|
||||
import { Suspense, memo, useCallback, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import urlJoin from 'url-join';
|
||||
|
||||
import { isDesktop } from '@/const/version';
|
||||
import NavItem from '@/features/NavPanel/components/NavItem';
|
||||
@@ -33,7 +32,7 @@ const TopicItem = memo<TopicItemProps>(({ id, title, fav, active, threadId }) =>
|
||||
// Construct href for cmd+click support
|
||||
const href = useMemo(() => {
|
||||
if (!activeAgentId || !id) return undefined;
|
||||
return urlJoin('/chat', `?agent=${activeAgentId}&topic=${id}`);
|
||||
return `/agent/${activeAgentId}?topic=${id}`;
|
||||
}, [activeAgentId, id]);
|
||||
|
||||
const [editing, isLoading] = useChatStore((s) => [
|
||||
|
||||
@@ -3,7 +3,6 @@ import { cssVar } from 'antd-style';
|
||||
import { MessageSquareDashed, Star } from 'lucide-react';
|
||||
import { Suspense, memo, useCallback, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import urlJoin from 'url-join';
|
||||
|
||||
import { isDesktop } from '@/const/version';
|
||||
import NavItem from '@/features/NavPanel/components/NavItem';
|
||||
@@ -35,7 +34,7 @@ const TopicItem = memo<TopicItemProps>(({ id, title, fav, active, threadId }) =>
|
||||
// Construct href for cmd+click support
|
||||
const href = useMemo(() => {
|
||||
if (!activeGroupId || !id) return undefined;
|
||||
return urlJoin('/group', activeGroupId, `?topic=${id}`);
|
||||
return `/group/${activeGroupId}?topic=${id}`;
|
||||
}, [activeGroupId, id]);
|
||||
|
||||
const [editing, isLoading] = useChatStore((s) => [
|
||||
|
||||
Reference in New Issue
Block a user