Do not consider first collection if it only has one file

This commit is contained in:
Daniel Lautzenheiser 2022-09-21 19:09:41 -04:00
parent f34beafc6b
commit 6f543d97b4

View File

@ -64,7 +64,7 @@ const ErrorCodeBlock = styled.pre`
`;
function getDefaultPath(collections) {
const first = collections.filter(collection => collection.get('hide') !== true).first();
const first = collections.filter(collection => collection.get('hide') !== true && (!collection.has('files') || collection.get('files').size > 1)).first();
if (first) {
return `/collections/${first.get('name')}`;
} else {