Document the magic number for future generations

858b7503462e190c7a69490b1a62859f1cf6d859

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -1Showing whitespace changes
public/scripts/RossAscends-mods.js+4 -1
@@ -316,7 +316,10 @@ export async function favsToHotswap() {
316316 const entities = getEntitiesList({ doFilter: false });
317317 const container = $('#right-nav-panel .hotswap');
318318
319- const favs = entities.filter(x => x.item.fav || x.item.fav == 'true').slice(0, 25);
319+ // Hard limit is required because even if all hotswaps don't fit the screen, their images would still be loaded
320+ // 25 is roughly calculated as the maximum number of favs that can fit an ultrawide monitor with the default theme
321+ const FAVS_LIMIT = 25;
322+ const favs = entities.filter(x => x.item.fav || x.item.fav == 'true').slice(0, FAVS_LIMIT);
320323
321324 //helpful instruction message if no characters are favorited
322325 if (favs.length == 0) {