optimising and making it better
This commit is contained in:
@@ -87,12 +87,6 @@ export class HomeComponent implements OnInit {
|
||||
topLevel.forEach(cat => {
|
||||
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;
|
||||
@@ -104,7 +98,7 @@ export class HomeComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
};
|
||||
img.src = cat.wideBanner as string;
|
||||
img.src = cat.wideBanner;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user