Skip to content

Commit 089a28d

Browse files
committed
fix: not using CDN images in some skins.
1 parent 1145a71 commit 089a28d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

services/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,8 @@ const getItemFromKey = key => {
824824
phase = getDopplerPhase(paintKits[name.toLowerCase()].paint_index);
825825
image =
826826
state.cdnImages[`${weaponIcons[1].icon_path.toLowerCase()}`] ??
827+
state.cdnImages[`${weaponIcons[1].icon_path.toLowerCase().replace(/_light$/, "_medium")}`] ??
828+
state.cdnImages[`${weaponIcons[1].icon_path.toLowerCase().replace(/_light$/, "_heavy")}`] ??
827829
getImageUrl(`${weaponIcons[1].icon_path.toLowerCase()}`);
828830
}
829831

services/skins.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ const parseItem = (item, items) => {
6363
const { rarities, paintKits, cratesBySkins, souvenirSkins, collectionsBySkins, cdnImages } = state;
6464
const [weapon, pattern] = getSkinInfo(item.icon_path);
6565
const dopplerPhase = getDopplerPhase(paintKits[pattern]?.paint_index);
66-
const image = cdnImages[item.icon_path.toLowerCase()]
67-
? cdnImages[item.icon_path.toLowerCase()]
68-
: getImageUrl(item.icon_path.toLowerCase());
66+
const image =
67+
state.cdnImages[`${item.icon_path.toLowerCase()}`] ??
68+
state.cdnImages[`${item.icon_path.toLowerCase().replace(/_light$/, "_medium")}`] ??
69+
state.cdnImages[`${item.icon_path.toLowerCase().replace(/_light$/, "_heavy")}`] ??
70+
getImageUrl(`${item.icon_path.toLowerCase()}`);
6971
const translatedName = !isNotWeapon(weapon)
7072
? $t(items[weapon].item_name_prefab)
7173
: $t(items[weapon].item_name);

0 commit comments

Comments
 (0)