diff --git a/frontend/components/item/Viewer.vue b/frontend/components/item/Viewer.vue index cb89be6..cad7cf7 100644 --- a/frontend/components/item/Viewer.vue +++ b/frontend/components/item/Viewer.vue @@ -11,12 +11,23 @@ for(let item of items.value) { watch(() => props.builds, () => trimBuilds(props.builds)) trimBuilds(props.builds) +trimLateGameItems(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) } +function trimLateGameItems(builds: Builds) { + function trimLateGameItemsFromTree(tree: ItemTree) { + const foundIndex = builds.lateGame.findIndex((x) => x.data === tree.data) + if(foundIndex != -1) builds.lateGame.splice(foundIndex, 1) + for(let children of tree.children) { + trimLateGameItemsFromTree(children) + } + } + trimLateGameItemsFromTree(builds.tree) +} @@ -90,7 +101,7 @@ function trimBuilds(builds : Builds) { -