fixed an issue where buying would require a query despite the auction being on the last requested page
This commit is contained in:
@@ -68,10 +68,10 @@ function Aux.buy.SearchButton_onclick()
|
||||
Aux.scan.start{
|
||||
query = search_query,
|
||||
page = 0,
|
||||
on_start_page = function(k, i)
|
||||
current_page = i
|
||||
set_message('Scanning auctions: page ' .. i + 1 .. ' ...')
|
||||
k()
|
||||
on_start_page = function(k, page)
|
||||
current_page = page
|
||||
set_message('Scanning auctions: page ' .. page + 1 .. ' ...')
|
||||
return k()
|
||||
end,
|
||||
on_read_auction = function(k, i)
|
||||
local auction_item = Aux.info.auction_item(i)
|
||||
@@ -80,7 +80,7 @@ function Aux.buy.SearchButton_onclick()
|
||||
process_auction(auction_item, current_page)
|
||||
end
|
||||
end
|
||||
k()
|
||||
return k()
|
||||
end,
|
||||
on_complete = function()
|
||||
entries = entries or {}
|
||||
|
||||
@@ -73,8 +73,6 @@ end
|
||||
|
||||
|
||||
function scan()
|
||||
|
||||
wait_for_callback(state.job.on_start_page, {state.page}, function() --;
|
||||
|
||||
submit_query(function() --;
|
||||
|
||||
@@ -95,7 +93,7 @@ function scan()
|
||||
state = nil
|
||||
end
|
||||
|
||||
end)end)end)
|
||||
end)end)
|
||||
end
|
||||
|
||||
function scan_auctions(count, k)
|
||||
@@ -116,6 +114,7 @@ end
|
||||
|
||||
function submit_query(k)
|
||||
if state.page then
|
||||
wait_for_callback(state.job.on_start_page, {state.page}, function() --;
|
||||
controller().wait(CanSendAuctionQuery, function() --;
|
||||
wait_for_results(k)
|
||||
QueryAuctionItems(
|
||||
@@ -129,7 +128,7 @@ function submit_query(k)
|
||||
state.job.query.usable,
|
||||
state.job.query.quality
|
||||
)
|
||||
end)
|
||||
end)end)
|
||||
else
|
||||
return k()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user