Document the magic number for future generations

This commit is contained in:
Cohee
2025-03-05 09:26:16 +00:00
parent f1b50caf1a
commit 858b750346

View File

@@ -316,7 +316,10 @@ export async function favsToHotswap() {
const entities = getEntitiesList({ doFilter: false }); const entities = getEntitiesList({ doFilter: false });
const container = $('#right-nav-panel .hotswap'); const container = $('#right-nav-panel .hotswap');
const favs = entities.filter(x => x.item.fav || x.item.fav == 'true').slice(0, 25); // Hard limit is required because even if all hotswaps don't fit the screen, their images would still be loaded
// 25 is roughly calculated as the maximum number of favs that can fit an ultrawide monitor with the default theme
const FAVS_LIMIT = 25;
const favs = entities.filter(x => x.item.fav || x.item.fav == 'true').slice(0, FAVS_LIMIT);
//helpful instruction message if no characters are favorited //helpful instruction message if no characters are favorited
if (favs.length == 0) { if (favs.length == 0) {