From 950c50f218a1569322dd0a7441dff14dac1a669f Mon Sep 17 00:00:00 2001 From: Tobias Reski Date: Mon, 15 Nov 2021 11:55:26 +0100 Subject: [PATCH] Adjusted method call order in the MapPageViewModel --- TINKLib/ViewModel/Map/MapPageViewModel.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/TINKLib/ViewModel/Map/MapPageViewModel.cs b/TINKLib/ViewModel/Map/MapPageViewModel.cs index d96e2fe..086405f 100644 --- a/TINKLib/ViewModel/Map/MapPageViewModel.cs +++ b/TINKLib/ViewModel/Map/MapPageViewModel.cs @@ -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().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. /// - private async Task MoveMapToCurrentPositionOfUser() + private async Task MoveMapToCurrentPositionOfUser(Status status) { - - Status status = await RequestLocationPermission(); if (status == Status.Granted) { ActionText = AppResources.ActivityTextCenterMap;