diff --git a/gehGassiApp/gehGassiApp/ViewModels/Subscriptions/SubscriptionsViewModel.cs b/gehGassiApp/gehGassiApp/ViewModels/Subscriptions/SubscriptionsViewModel.cs index 60e77f6..c933519 100644 --- a/gehGassiApp/gehGassiApp/ViewModels/Subscriptions/SubscriptionsViewModel.cs +++ b/gehGassiApp/gehGassiApp/ViewModels/Subscriptions/SubscriptionsViewModel.cs @@ -33,6 +33,7 @@ namespace gehGassiApp.ViewModels.Subscriptions private readonly IDispatcher _dispatcher; private readonly IDialogService _dialogService; private readonly IPopupService _popupService; + private bool _hasShownSuccessPopupThisSession; /// /// ERstellt eine Instanz @@ -209,15 +210,7 @@ namespace gehGassiApp.ViewModels.Subscriptions await LoadAsync(); if (MySubscriptions != null && MySubscriptions.Any()) { - var popupResult = await _popupService.ShowPopupAsync( - Shell.Current - ); - - var result = popupResult.Result; - if (result != null && result.HasOpenedStrayz) - { - // User hat STRAYZ geöffnet - } + await ShowSubscriptionSuccessPopupAsync(force: true); } } else @@ -436,15 +429,27 @@ namespace gehGassiApp.ViewModels.Subscriptions IsBusy = false; if (MySubscriptions != null && MySubscriptions.Any()) { - var popupResult = await _popupService.ShowPopupAsync( - Shell.Current - ); - - var result = popupResult.Result; - if (result != null && result.HasOpenedStrayz) - { - // User hat STRAYZ geöffnet - } + await ShowSubscriptionSuccessPopupAsync(); + } + } + + private async Task ShowSubscriptionSuccessPopupAsync(bool force = false) + { + if (_hasShownSuccessPopupThisSession && !force) + { + return; + } + + var popupResult = await _popupService.ShowPopupAsync( + Shell.Current + ); + + _hasShownSuccessPopupThisSession = true; + + var result = popupResult.Result; + if (result != null && result.HasOpenedStrayz) + { + // User hat STRAYZ geöffnet } } @@ -889,6 +894,8 @@ namespace gehGassiApp.ViewModels.Subscriptions HasError = false; ErrorMessage = string.Empty; + _hasShownSuccessPopupThisSession = false; + await TrackPageViewAsync("Subscriptions"); ShowSubscriptions = false; @@ -914,6 +921,8 @@ namespace gehGassiApp.ViewModels.Subscriptions HasError = false; ErrorMessage = string.Empty; + _hasShownSuccessPopupThisSession = false; + return base.DisappearingAsync(sender); } diff --git a/gehGassiApp/gehGassiApp/Views/Popups/AGBUpdatePopup.xaml b/gehGassiApp/gehGassiApp/Views/Popups/AGBUpdatePopup.xaml index fd47309..49b3f91 100644 --- a/gehGassiApp/gehGassiApp/Views/Popups/AGBUpdatePopup.xaml +++ b/gehGassiApp/gehGassiApp/Views/Popups/AGBUpdatePopup.xaml @@ -7,81 +7,74 @@ xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" xmlns:viewModels="clr-namespace:gehGassiApp.ViewModels.Popups" x:DataType="viewModels:AGBUpdatePopupViewModel" - CanBeDismissedByTappingOutsideOfPopup="False"> - - + - - - - - - - + + + + + + + - - - - -