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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user