Skip to content

Commit 085654c

Browse files
committed
Remove error code on login and fix hanging item slot controls in tradequery
1 parent ba17e17 commit 085654c

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/Classes/TradeQuery.lua

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,8 @@ Highest Weight - Displays the order retrieved from trade]]
484484
main.lastRefreshToken = main.api.refreshToken
485485
main.tokenExpiry = main.api.tokenExpiry
486486
main:SaveSettings()
487+
488+
TradeQueryClass:SetNotice(self.controls.pbNotice, "")
487489
else
488490
self.charImportStatus = colorCodes.WARNING.."Not authenticated"
489491
end
@@ -531,6 +533,16 @@ Highest Weight - Displays the order retrieved from trade]]
531533
self.controls["name"..row_count].shown = function()
532534
return hideRowFunc(self, row_count)
533535
end
536+
537+
-- fix case where the row count is reduced from the last time the popup was
538+
-- opened, which would leave extra row controls in the menu
539+
for k, v in pairs(self.controls) do
540+
local number = k:match("(%d+)")
541+
if number and tonumber(number) > row_count then
542+
self.controls[k] = nil
543+
end
544+
end
545+
534546
row_count = row_count + 2
535547

536548
local effective_row_count = row_count - ((scrollBarShown and #slotTables >= 19) and #slotTables-19 or 0) + 2 + 2 -- Two top menu rows, two bottom rows, slots after #19 overlap the other controls at the bottom of the pane
@@ -551,12 +563,6 @@ Highest Weight - Displays the order retrieved from trade]]
551563
self.controls.fullPrice = new("LabelControl", {"BOTTOM", nil, "BOTTOM"}, {0, -row_height - pane_margins_vertical - row_vertical_padding, pane_width - 2 * pane_margins_horizontal, row_height}, "")
552564
self.controls.close = new("ButtonControl", {"BOTTOM", nil, "BOTTOM"}, {0, -pane_margins_vertical, 90, row_height}, "Done", function()
553565
main:ClosePopup()
554-
-- there's a case where if you have a socket(s) allocated, open TradeQuery, close it, dealloc, then open TradeQuery again
555-
-- the deallocated socket controls were still showing, so this will remove all dynamically created controls from items
556-
557-
-- later note: this is disabled because it causes the trader to crash if
558-
-- it's closed mid-search
559-
-- wipeItemControls()
560566
end)
561567

562568
self.controls.updateCurrencyConversion = new("ButtonControl", {"BOTTOMLEFT", nil, "BOTTOMLEFT"}, {pane_margins_horizontal, -pane_margins_vertical, 240, row_height}, "Get Currency Conversion Rates", function()

0 commit comments

Comments
 (0)