From 43af20be9b1bc5c422ee2160cb4caaaefec567d1 Mon Sep 17 00:00:00 2001 From: Alexander Drozdov Date: Wed, 16 Dec 2020 16:39:56 +0200 Subject: [PATCH] fix league filter --- src/web/price-check/Leagues.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web/price-check/Leagues.ts b/src/web/price-check/Leagues.ts index 3415c26d..f41ce230 100644 --- a/src/web/price-check/Leagues.ts +++ b/src/web/price-check/Leagues.ts @@ -34,10 +34,10 @@ export class LeaguesService { this.state.loadingError = undefined try { - const response = await fetch('https://api.pathofexile.com/leagues?type=main&realm=pc&compact=1') + const response = await fetch('https://api.pathofexile.com/leagues?type=main&realm=pc') if (!response.ok) throw new Error(JSON.stringify(Object.fromEntries(response.headers))) - const leagues: Array<{ id: string }> = await response.json() - const tradeLeagues = leagues.filter(league => !league.id.startsWith('SSF ')) + const leagues: Array<{ id: string, rules: Array<{ id: string }> }> = await response.json() + const tradeLeagues = leagues.filter(league => !league.rules.some(rule => rule.id === 'NoParties')) this.state.tradeLeagues = tradeLeagues const leagueIsAlive = tradeLeagues.some(league => league.id === Config.store.leagueId)