@@ -366,35 +366,37 @@ function M.openPopup(item, slotName, primaryBuild)
366366 end )
367367 end
368368
369+ local function rebuildUrl ()
370+ local result = buildURL (item , slotName , controls , modEntries , defenceEntries , isUnique )
371+ uri = result
372+ end
369373 -- Realm dropdown
370374 controls .realmLabel = new (" LabelControl" , {" TOPLEFT" , nil , " TOPLEFT" }, {leftMargin , ctrlY , 0 , 16 }, " ^7Realm:" )
371375 controls .realmDrop = new (" DropDownControl" , {" LEFT" , controls .realmLabel , " RIGHT" }, {4 , 0 , 80 , 20 }, {" PC" , " PS4" , " Xbox" }, function (index , value )
372376 local realmApiId = REALM_API_IDS [value ] or " pc"
373377 fetchLeaguesForRealm (realmApiId )
378+ rebuildUrl ()
374379 end )
375380
376381 -- League dropdown
377382 controls .leagueLabel = new (" LabelControl" , {" LEFT" , controls .realmDrop , " RIGHT" }, {12 , 0 , 0 , 16 }, " ^7League:" )
378383 controls .leagueDrop = new (" DropDownControl" , {" LEFT" , controls .leagueLabel , " RIGHT" }, {4 , 0 , 160 , 20 }, {" Loading..." }, function (index , value )
379384 -- League selection stored in the dropdown itself
385+ rebuildUrl ()
380386 end )
381387 controls .leagueDrop .enabled = function () return # controls .leagueDrop .list > 0 and controls .leagueDrop .list [1 ] ~= " Loading..." end
382388
383389 -- Listed status dropdown
384390 controls .listedDrop = new (" DropDownControl" , {" TOPRIGHT" , nil , " TOPRIGHT" }, {- leftMargin , ctrlY , 242 , 20 }, LISTED_STATUS_LABELS , function (index , value )
385391 -- Listed status selection stored in the dropdown itself
392+ rebuildUrl ()
386393 end )
387394 controls .listedLabel = new (" LabelControl" , {" RIGHT" , controls .listedDrop , " LEFT" }, {- 4 , 0 , 0 , 16 }, " ^7Listed:" )
388395
389396 -- Fetch initial leagues for default realm
390397 fetchLeaguesForRealm (" pc" )
391398 ctrlY = ctrlY + rowHeight + 4
392399
393- local function rebuildUrl ()
394- local result = buildURL (item , slotName , controls , modEntries , defenceEntries , isUnique )
395- uri = result
396- end
397-
398400
399401 if isUnique then
400402 -- Unique item name label
0 commit comments