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:
Alex committed 2026-06-22 23:26:12 +01:00
1 parent 54773cdf0f
commit 2616ec5d1b
1 file changed
+3 -2
+3 -2
View File
@@ -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}