fixed an issue where buying would require a query despite the auction being on the last requested page

This commit is contained in:
Manuel Simon Hirsig
2015-10-04 06:03:03 +02:00
parent 1bdac168e4
commit 38c036a338
2 changed files with 8 additions and 9 deletions
+5 -5
View File
@@ -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 {}
+3 -4
View File
@@ -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