mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-09 06:15:21 +02:00
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:
1 parent
d6bb71f324
commit
971513d3ae
1 file changed
+6
-4
@@ -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