Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: fixed the knowledge files cant open error (#10386)

Shinji-Li8104c774d5ea
diff --git a/src/app/[variants]/desktopRouter.config.tsx b/src/app/[variants]/desktopRouter.config.tsx
index f620f740f68..07247ca2519 100644
--- a/src/app/[variants]/desktopRouter.config.tsx
+++ b/src/app/[variants]/desktopRouter.config.tsx
@@ -385,6 +385,11 @@ export const createDesktopRouter = (locale: Locales) =>
element: <KnowledgeHome />,
index: true,
},
+ {
+ element: <KnowledgeHome />,
+ loader: idLoader,
+ path: ':id',
+ },
{
element: <KnowledgeBasesList />,
path: 'bases',
diff --git a/src/app/[variants]/mobileRouter.config.tsx b/src/app/[variants]/mobileRouter.config.tsx
index 056b730e15a..1ea869422dc 100644
--- a/src/app/[variants]/mobileRouter.config.tsx
+++ b/src/app/[variants]/mobileRouter.config.tsx
@@ -402,6 +402,11 @@ export const createMobileRouter = (locale: Locales) =>
element: <KnowledgeHome />,
index: true,
},
+ {
+ element: <KnowledgeHome />,
+ loader: idLoader,
+ path: ':id',
+ },
{
element: <KnowledgeBasesList />,
path: 'bases',
diff --git a/src/features/KnowledgeManager/Home/index.tsx b/src/features/KnowledgeManager/Home/index.tsx
index ad576742a54..f34929ff26a 100644
--- a/src/features/KnowledgeManager/Home/index.tsx
+++ b/src/features/KnowledgeManager/Home/index.tsx
@@ -104,7 +104,7 @@ const Home = memo<HomeProps>(({ knowledgeBaseId, onOpenFile }) => {
const handleDocumentClick = (documentId: string) => {
// Navigate to the document in the explorer
// The KnowledgeHomePage will automatically set category to 'documents' when it detects the id param
- navigate(`/${documentId}`);
+ navigate(`/knowledge/${documentId}`);
};
return (