diff --git a/frontend/components/ChampionTitle.vue b/frontend/components/ChampionTitle.vue index 74ed3c1..507209d 100644 --- a/frontend/components/ChampionTitle.vue +++ b/frontend/components/ChampionTitle.vue @@ -1,18 +1,17 @@ diff --git a/frontend/components/ItemViewer.vue b/frontend/components/ItemViewer.vue index f8d71db..dfc350e 100644 --- a/frontend/components/ItemViewer.vue +++ b/frontend/components/ItemViewer.vue @@ -2,7 +2,6 @@ const props = defineProps<{ builds: Builds }>() -const builds = props.builds const {data : items} : ItemResponse = await useFetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/items.json") const itemMap = reactive(new Map()) @@ -10,9 +9,15 @@ for(let item of items.value) { itemMap.set(item.id, item) } -builds.tree.children.splice(1, builds.tree.children.length - 1) -if(builds.tree.children[0] != null && builds.tree.children[0] != undefined) - builds.tree.children[0].children.splice(1, builds.tree.children[0].children.length - 1) +watch(() => props.builds, () => trimBuilds(props.builds)) +trimBuilds(props.builds) + +function trimBuilds(builds : Builds) { + builds.tree.children.splice(1, builds.tree.children.length - 1) + if(builds.tree.children[0] != null && builds.tree.children[0] != undefined) + builds.tree.children[0].children.splice(1, builds.tree.children[0].children.length - 1) +} +