Fixed champion removal bug
All checks were successful
pipeline / build-and-push-images (push) Successful in 25s
pipeline / deploy (push) Successful in 6s

This commit is contained in:
2024-11-25 15:49:03 +01:00
parent fd4cbc3e44
commit f20026542b

View File

@@ -1,17 +1,18 @@
<script setup> <script setup>
const {data: champions} = await useFetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json") const {data: championsData} = await useFetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json")
champions.value = champions.value.slice(1).sort((a, b) => { const champions = championsData.value.slice(1).sort((a, b) => {
if(a.name < b.name) return -1; if(a.name < b.name) return -1;
if(a.name > b.name) return 1; if(a.name > b.name) return 1;
return 0; return 0;
}) })
const filteredChampions = ref(champions.value)
const filteredChampions = ref(champions)
const searchBar = ref(null) const searchBar = ref(null)
watch(searchBar, (newS, oldS) => {searchBar.value.focus()}) watch(searchBar, (newS, oldS) => {searchBar.value.focus()})
const searchText = ref("") const searchText = ref("")
watch(searchText, (newT, oldT) => { watch(searchText, (newT, oldT) => {
filteredChampions.value = champions.value.filter((champion) => champion.name.toLowerCase().includes(searchText.value.toLowerCase())) filteredChampions.value = champions.filter((champion) => champion.name.toLowerCase().includes(searchText.value.toLowerCase()))
}) })
async function submit() { async function submit() {