Adjusted method call order in the MapPageViewModel

This commit is contained in:
Tobias Reski 2021-11-15 11:55:26 +01:00
parent 6181f3aec1
commit 950c50f218

View file

@ -314,6 +314,7 @@ namespace TINK.ViewModel.Map
ActiveFilterMap = TinkApp.GroupFilterMapPage;
ActionText = AppResources.ActivityTextRequestingLocationPermissions;
Status status = await RequestLocationPermission();
ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes;
IsConnected = TinkApp.GetIsConnected();
@ -338,9 +339,10 @@ namespace TINK.ViewModel.Map
Log.ForContext<MapPageViewModel>().Verbose("Update pins color done.");
// Move and scale before getting stations and bikes which takes some time.
ActionText = AppResources.ActivityTextCenterMap;
await MoveMapToCurrentPositionOfUser(status);
m_oViewUpdateManager = CreateUpdateTask();
try
@ -357,8 +359,6 @@ namespace TINK.ViewModel.Map
ActionText = "";
IsRunning = false;
IsMapPageEnabled = true;
await MoveMapToCurrentPositionOfUser();
}
catch (Exception l_oException)
{
@ -450,10 +450,8 @@ namespace TINK.ViewModel.Map
/// Moves the map to the current position of the user.
/// If location permission hasn't been granted, the position is not adjusted.
/// </summary>
private async Task MoveMapToCurrentPositionOfUser()
private async Task MoveMapToCurrentPositionOfUser(Status status)
{
Status status = await RequestLocationPermission();
if (status == Status.Granted)
{
ActionText = AppResources.ActivityTextCenterMap;