Skip to content

Commit de77bf3

Browse files
committed
fix(homePatch): handle featured separator item
Stops a blank space from appearing when in-game
1 parent 44053e6 commit de77bf3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/patches/homePatch.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export const addHomePatch = (mounting = false, square = false, matchFeatured = f
184184
*/
185185
let siblingWidth = 0;
186186
afterPatch(carouselProps, 'fnGetColumnWidth', ([index], colWidth: number) => {
187-
if (index === 1) {
187+
if (index === 2) { // always refereces the second item in case the separator is present
188188
siblingWidth = colWidth;
189189
}
190190
return colWidth;
@@ -197,6 +197,10 @@ export const addHomePatch = (mounting = false, square = false, matchFeatured = f
197197
height: a - parseInt(or().LabelHeight)
198198
*/
199199
const capsuleHeight = itemHeight - parseInt(homeCarouselClasses.LabelHeight);
200+
// the separator item should not be changed, also matches the second item, but it doesn't matter
201+
if (index === 1) {
202+
return callOriginal;
203+
}
200204
if (square) return capsuleHeight;
201205
return siblingWidth ? siblingWidth : calculateDefaultCapsuleWidth(capsuleHeight);
202206
});

0 commit comments

Comments
 (0)