Exemple #1
0
        private async Task SetRecommendationsAsync()
        {
            try
            {
                var profile = await _userProfileContainer.GetAsync();

                var statusId = profile?.StatusId;
                if (statusId != null)
                {
                    IsBusy = true;

                    var recommendationsList =
                        await _recommendationsService.GetRecommendationsAsync(statusId.Value, LifecycleToken);

                    _models.Edit((innerList) =>
                    {
                        innerList.Clear();
                        innerList.AddRange(recommendationsList.Data);
                    });
                }
            }
            catch (Exception e)
            {
                await _errorHandler.HandleAsync(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemple #2
0
        private async Task <bool> IsAuthenticatedAsync()
        {
            try
            {
                var isInitialized = SecretsProvider.Instance.GetIsInitialized();
                if (!isInitialized)
                {
                    return(false);
                }

                var result = await _userProfileContainer.GetAsync().ConfigureAwait(false);

                return(result != null);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Failed to check user authenticated status.");
                return(false);
            }
        }