From eed57126ba990f05da7f8995fc34ea688bf8e2b6 Mon Sep 17 00:00:00 2001 From: Kalane Date: Sat, 11 Dec 2021 19:17:45 +0100 Subject: [PATCH] fix(live-game): spellbook smite icon --- client/src/data/summonerSpells.json | 13 ++++++++++--- client/src/helpers/summoner.js | 6 +++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/client/src/data/summonerSpells.json b/client/src/data/summonerSpells.json index 75f70fe..55a6245 100644 --- a/client/src/data/summonerSpells.json +++ b/client/src/data/summonerSpells.json @@ -305,9 +305,16 @@ "description": "", "summonerLevel": 1, "cooldown": 0, - "gameModes": [ - "ULTBOOK" - ], + "gameModes": ["ULTBOOK"], "iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_Empty.png" + }, + { + "id": 55, + "name": "Placeholder and Attack-Smite", + "description": "This slot will be replaced by another champion's ultimate and you will gain Attack-Smite. There will be 30 seconds to select an ultimate. Be prepared!", + "summonerLevel": 1, + "cooldown": 0, + "gameModes": ["ULTBOOK"], + "iconPath": "/lol-game-data/assets/DATA/Spells/Icons2D/Summoner_EmptySmite.png" } ] \ No newline at end of file diff --git a/client/src/helpers/summoner.js b/client/src/helpers/summoner.js index dd96f88..b2bc2f8 100644 --- a/client/src/helpers/summoner.js +++ b/client/src/helpers/summoner.js @@ -120,6 +120,10 @@ export function getRankImg(leagueData) { export function getSummonerLink(id) { if (id === 0) return null - const spellName = summonerSpells.find(s => s.id === id).iconPath.split('/assets/')[1].toLowerCase() + + const spell = summonerSpells.find((s) => s.id === id) + if (!spell) return null + + const spellName = spell.iconPath.split('/assets/')[1].toLowerCase() return `https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/${spellName}` }