Refactor: Resolve vscode type error in renderStatsCard function card width calc (#2984)

This commit is contained in:
Alexandr Garbuzov 2023-07-24 21:55:05 +03:00 committed by GitHub
parent b6d5835441
commit 833324fc0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -294,7 +294,11 @@ const renderStatsCard = (stats, options = {}) => {
: statItems.length
? RANK_CARD_DEFAULT_WIDTH
: RANK_ONLY_CARD_DEFAULT_WIDTH) + iconWidth;
let width = isNaN(card_width) ? defaultCardWidth : card_width;
let width = card_width
? isNaN(card_width)
? defaultCardWidth
: card_width
: defaultCardWidth;
if (width < minCardWidth) {
width = minCardWidth;
}