diff --git a/src/app/models/category.model.ts b/src/app/models/category.model.ts
index 7f14975..9b4501a 100644
--- a/src/app/models/category.model.ts
+++ b/src/app/models/category.model.ts
@@ -3,6 +3,7 @@ export interface Category {
name: string;
parentID: number;
icon?: string;
- wideBanner?: string;
+ wideBanner?: string | boolean;
itemCount?: number;
+ priority?: number;
}
diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html
index 23ed3dd..071f4c8 100644
--- a/src/app/pages/home/home.component.html
+++ b/src/app/pages/home/home.component.html
@@ -130,7 +130,7 @@
class="dexar-category-card"
[class.dexar-category-card--wide]="isWideCategory(category.categoryID)">
- @if (isWideCategory(category.categoryID) && category.wideBanner) {
+ @if (isWideCategory(category.categoryID) && category.wideBanner && category.wideBanner !== true) {
![]()
} @else if (category.icon) {
![]()
diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts
index fb563ef..61b83a6 100644
--- a/src/app/pages/home/home.component.ts
+++ b/src/app/pages/home/home.component.ts
@@ -22,7 +22,9 @@ export class HomeComponent implements OnInit {
// Memoized computed values for performance
topLevelCategories = computed(() => {
- return this.categories().filter(cat => cat.parentID === 0);
+ return this.categories()
+ .filter(cat => cat.parentID === 0)
+ .sort((a, b) => (a.priority ?? Infinity) - (b.priority ?? Infinity));
});
// Memoized item count lookup
@@ -83,8 +85,14 @@ export class HomeComponent implements OnInit {
private detectWideImages(categories: Category[]): void {
const topLevel = categories.filter(c => c.parentID === 0);
topLevel.forEach(cat => {
- const src = cat.wideBanner || null;
- if (!src) return;
+ if (!cat.wideBanner) return;
+
+ // API may send wideBanner as a boolean flag instead of a URL
+ if (cat.wideBanner === true) {
+ this.wideCategories.update(set => { const next = new Set(set); next.add(cat.categoryID); return next; });
+ return;
+ }
+
const img = new Image();
img.onload = () => {
const ratio = img.naturalWidth / img.naturalHeight;
@@ -96,7 +104,7 @@ export class HomeComponent implements OnInit {
});
}
};
- img.src = src;
+ img.src = cat.wideBanner as string;
});
}