Added basic tierlist (fix #4)
This commit is contained in:
@@ -6,8 +6,8 @@ const champions = championsData.value.slice(1).sort((a, b) => {
|
||||
return 0;
|
||||
})
|
||||
|
||||
const {data: championsLanes} : {data: Ref<any>} = await useFetch("/api/champions")
|
||||
const lanesMap = new Map()
|
||||
const {data: championsLanes} : {data: Ref<Array<ChampionData>>} = await useFetch("/api/champions")
|
||||
const lanesMap : Map<string, Array<LaneData>> = new Map()
|
||||
for(let champion of championsLanes.value) {
|
||||
lanesMap.set(champion.alias, champion.lanes)
|
||||
}
|
||||
@@ -39,7 +39,7 @@ function filterToLane(filter: number) {
|
||||
function onLaneFilterChange(newValue: number) {
|
||||
if(newValue != -1) {
|
||||
filteredChampions.value = champions.filter((champion) => {
|
||||
const lanes : Array<any> = lanesMap.get(champion.alias.toLowerCase())
|
||||
const lanes : Array<LaneData> | undefined = lanesMap.get(champion.alias.toLowerCase())
|
||||
if(lanes == undefined) return false;
|
||||
|
||||
return lanes.reduce((acc : boolean, current : {data:string, count:number}) =>
|
||||
|
||||
Reference in New Issue
Block a user