Skip to content

Commit

Permalink
Fix timeless jewel trade league url (#7565)
Browse files Browse the repository at this point in the history
* Update TreeTabClass to default to the first league in the dropdown if no league was selected.

* Restore the last used league on window open
  • Loading branch information
tbiering authored Jun 27, 2024
1 parent 5960a5b commit 99cd9ba
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Classes/TreeTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,13 @@ function TreeTabClass:FindTimelessJewel()
controls.msg = new("LabelControl", nil, -280, 5, 0, 16, "")
if #self.tradeLeaguesList > 0 then
controls.searchTradeLeagueSelect:SetList(self.tradeLeaguesList)
-- restore the last league selected
for i, league in ipairs(self.tradeLeaguesList) do
if league == self.timelessJewelLeagueSelect then
controls.searchTradeLeagueSelect:SetSel(i)
break
end
end
else
self.tradeQueryRequests:FetchLeagues("pc", function(leagues, errMsg)
if errMsg then
Expand Down Expand Up @@ -1904,7 +1911,10 @@ function TreeTabClass:FindTimelessJewel()
end
end

Copy("https://www.pathofexile.com/trade/search/"..(self.timelessJewelLeagueSelect or "").."/?q=" .. (s_gsub(dkjson.encode(search), "[^a-zA-Z0-9]", function(a)
-- if the league was not selected via dropdown, then default to the first league in the dropdown or "" if the leagues could not be read
self.timelessJewelLeagueSelect = self.timelessJewelLeagueSelect or (self.tradeLeaguesList and #self.tradeLeaguesList > 0 and self.tradeLeaguesList[1]) or ""

Copy("https://www.pathofexile.com/trade/search/"..(self.timelessJewelLeagueSelect).."/?q=" .. (s_gsub(dkjson.encode(search), "[^a-zA-Z0-9]", function(a)
return s_format("%%%02X", s_byte(a))
end)))

Expand Down

0 comments on commit 99cd9ba

Please sign in to comment.