fix: default company export page to README.md instead of first file

When navigating to the company export page without a specific file in
the URL, select README.md by default instead of whichever file happens
to be first in the export result (previously COMPANY.md).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta
2026-03-20 07:59:32 -05:00
parent d6bb71f324
commit 971513d3ae

View File

@@ -609,10 +609,12 @@ export function CompanyExport() {
const ancestors = expandAncestors(urlFile);
setExpandedDirs(new Set([...topDirs, ...ancestors]));
} else {
// Select first file and update URL
const firstFile = Object.keys(result.files)[0];
if (firstFile) {
selectFile(firstFile, true);
// Default to README.md if present, otherwise fall back to first file
const defaultFile = "README.md" in result.files
? "README.md"
: Object.keys(result.files)[0];
if (defaultFile) {
selectFile(defaultFile, true);
}
setExpandedDirs(topDirs);
}