Skip to content

Commit

Permalink
Use first collection when no layout-collections specified (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvire authored Jan 23, 2024
1 parent 794fda5 commit 828b8e2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/convertConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -785,9 +785,12 @@ function convertConfig(dataDir: string, verbose: number) {
}
}
const layoutCollectionElements = layout.getElementsByTagName('layout-collection');
const layoutCollections = Array.from(layoutCollectionElements).map((element) => {
return element.attributes.getNamedItem('id')!.value;
});
const layoutCollections =
layoutCollectionElements.length > 0
? Array.from(layoutCollectionElements).map((element) => {
return element.attributes.getNamedItem('id')!.value;
})
: [data.bookCollections[0].id];

data.layouts.push({
mode,
Expand Down

0 comments on commit 828b8e2

Please sign in to comment.