Do not consider first collection if it only has one file
This commit is contained in:
parent
f34beafc6b
commit
6f543d97b4
@ -64,7 +64,7 @@ const ErrorCodeBlock = styled.pre`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
function getDefaultPath(collections) {
|
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) {
|
if (first) {
|
||||||
return `/collections/${first.get('name')}`;
|
return `/collections/${first.get('name')}`;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user