mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-15 00:16:46 +00:00
fix(wiki): detect wiki sources by config.kind, not type
A converted source keeps its origin type (e.g. crawler) with the wiki-ness in config.kind=wiki (D5/D20), so the UI's type==='wiki' checks treated converted sources as normal (wrong view, convert action still offered). Sources.tsx now keys isWiki + the view branch on config.kind==='wiki' (with a type fallback for blank-created wikis). The paginated endpoint already returns config.
This commit is contained in:
1 parent
54773cdf0f
commit
2616ec5d1b
1 file changed
+3
-2
@@ -337,7 +337,7 @@ export default function Sources({
|
||||
index: number,
|
||||
document: Doc,
|
||||
): SourceMenuOption[] => {
|
||||
const isWiki = document.type === 'wiki';
|
||||
const isWiki = document.config?.kind === 'wiki' || document.type === 'wiki';
|
||||
// 'team' viewers cannot write; convert is owner/editor only.
|
||||
const canEdit =
|
||||
document.ownership !== 'team' || document.team_access === 'editor';
|
||||
@@ -464,7 +464,8 @@ export default function Sources({
|
||||
|
||||
return documentToView ? (
|
||||
<div className="mt-8 flex flex-col">
|
||||
{documentToView.type === 'wiki' ? (
|
||||
{documentToView.config?.kind === 'wiki' ||
|
||||
documentToView.type === 'wiki' ? (
|
||||
<WikiViewer
|
||||
docId={documentToView.id || ''}
|
||||
sourceName={documentToView.name}
|
||||
|
||||
Reference in new issue
Block a user