Update function corrected: Selected bike is updated, not MyBikes.

This commit is contained in:
Oliver Hauff 2021-07-14 23:31:30 +02:00
parent d874877998
commit a7eba321bb

View file

@ -247,7 +247,7 @@ namespace TINK.ViewModel.FindBike
}, },
null); null);
var result = ConnectorFactory(IsConnected).Query.GetBikesOccupiedAsync().Result; var result = ConnectorFactory(IsConnected).Query.GetBikesAsync().Result;
var bikes = result.Response; var bikes = result.Response;
@ -257,6 +257,12 @@ namespace TINK.ViewModel.FindBike
Log.ForContext<FindBikePageViewModel>().Error("Getting bikes occupied in polling context failed with exception {Exception}.", exception); Log.ForContext<FindBikePageViewModel>().Error("Getting bikes occupied in polling context failed with exception {Exception}.", exception);
} }
var selectedBike = bikes.FirstOrDefault(x => x.Id.Equals(BikeIdUserInput.Trim(), StringComparison.OrdinalIgnoreCase));
bikes = selectedBike != null
? new BikeCollection(new Dictionary<string, Model.Bike.BC.BikeInfo> { { selectedBike.Id, selectedBike } })
: new BikeCollection();
PostAction( PostAction(
unused => unused =>
{ {