Skip to content

Commit a6abba1

Browse files
committed
Refactor: Resolve vscode type error in renderStatsCard function card width calc (anuraghazra#2984)
1 parent 166d10d commit a6abba1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cards/stats-card.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,11 @@ const renderStatsCard = (stats, options = {}) => {
294294
: statItems.length
295295
? RANK_CARD_DEFAULT_WIDTH
296296
: RANK_ONLY_CARD_DEFAULT_WIDTH) + iconWidth;
297-
let width = isNaN(card_width) ? defaultCardWidth : card_width;
297+
let width = card_width
298+
? isNaN(card_width)
299+
? defaultCardWidth
300+
: card_width
301+
: defaultCardWidth;
298302
if (width < minCardWidth) {
299303
width = minCardWidth;
300304
}

0 commit comments

Comments
 (0)