fix #15, thanks @bontibon

This commit is contained in:
Carson McManus 2017-06-04 14:58:52 -04:00
parent b7d6489ea9
commit a94d224282

View file

@ -596,7 +596,9 @@ namespace SteamGuard
} }
} }
Console.WriteLine("Retrieving trade confirmations..."); Console.WriteLine("Retrieving trade confirmations...");
var trades = account.FetchConfirmations(); var tradesTask = account.FetchConfirmationsAsync();
tradesTask.Wait();
var trades = tradesTask.Result;
var tradeActions = new TradeAction[trades.Length]; var tradeActions = new TradeAction[trades.Length];
for (var i = 0; i < tradeActions.Length; i++) for (var i = 0; i < tradeActions.Length; i++)
{ {
@ -743,7 +745,9 @@ namespace SteamGuard
if (Verbose) Console.WriteLine("Refeshing Session..."); if (Verbose) Console.WriteLine("Refeshing Session...");
account.RefreshSession(); account.RefreshSession();
if (Verbose) Console.WriteLine("Fetching Confirmations..."); if (Verbose) Console.WriteLine("Fetching Confirmations...");
Confirmation[] confirmations = account.FetchConfirmations(); var tradesTask = account.FetchConfirmationsAsync();
tradesTask.Wait();
Confirmation[] confirmations = tradesTask.Result;
if (Verbose) Console.WriteLine("Accepting Confirmations..."); if (Verbose) Console.WriteLine("Accepting Confirmations...");
account.AcceptMultipleConfirmations(confirmations); account.AcceptMultipleConfirmations(confirmations);
break; break;
@ -755,7 +759,9 @@ namespace SteamGuard
if (Verbose) Console.WriteLine("Refeshing Session..."); if (Verbose) Console.WriteLine("Refeshing Session...");
account.RefreshSession(); account.RefreshSession();
if (Verbose) Console.WriteLine("Fetching Confirmations..."); if (Verbose) Console.WriteLine("Fetching Confirmations...");
Confirmation[] confirmations = account.FetchConfirmations(); var tradesTask = account.FetchConfirmationsAsync();
tradesTask.Wait();
Confirmation[] confirmations = tradesTask.Result;
if (Verbose) Console.WriteLine("Accepting Confirmations..."); if (Verbose) Console.WriteLine("Accepting Confirmations...");
account.AcceptMultipleConfirmations(confirmations); account.AcceptMultipleConfirmations(confirmations);
} }