diff --git a/client/components/covers/SortedCovers.vue b/client/components/covers/SortedCovers.vue index 4f75df7bb..9cb02fdb8 100644 --- a/client/components/covers/SortedCovers.vue +++ b/client/components/covers/SortedCovers.vue @@ -15,8 +15,8 @@ - -
+ +
@@ -57,9 +57,10 @@ export default { computed: { // Sort covers by dimension and size sortedCovers() { + // sort by height, then sub-sort by width return [...this.covers].sort((a, b) => { - // Sort by area (width * height) - return a.width * a.height - b.width * b.height + // Sort by height first, then by width + return a.height - b.height || a.width - b.width }) }, // Get square covers (width === height) @@ -77,6 +78,10 @@ export default { // Determine secondary covers (opposite of primary) secondaryCovers() { return this.bookCoverAspectRatio === 1 ? this.rectangleCovers : this.squareCovers + }, + // Check if we have both types of covers to show the divider + hasBothCoverTypes() { + return this.primaryCovers.length > 0 && this.secondaryCovers.length > 0 } } }