diff --git a/My1kWordsEe/Components/Pages/FavoritesPage.razor b/My1kWordsEe/Components/Pages/FavoritesPage.razor index 208e332..48dca13 100644 --- a/My1kWordsEe/Components/Pages/FavoritesPage.razor +++ b/My1kWordsEe/Components/Pages/FavoritesPage.razor @@ -46,7 +46,7 @@ foreach (var wordPair in favorites.Words) { var word = wordPair.Value; -
+
diff --git a/My1kWordsEe/Components/Pages/Word.razor b/My1kWordsEe/Components/Pages/Word.razor index 7890795..fbc1540 100644 --- a/My1kWordsEe/Components/Pages/Word.razor +++ b/My1kWordsEe/Components/Pages/Word.razor @@ -59,11 +59,6 @@ if (favorites.Result.IsSuccess) { Favorites = favorites.Result; - var favoriteWords = favorites.Result.Value.Words; - if (favoriteWords.ContainsKey(EeWord)) - { - return favoriteWords[EeWord]; - } } } @@ -114,6 +109,8 @@ private string Error => WordMetadata.Value.Error; private bool IsLoggedIn => User?.Identity?.IsAuthenticated ?? false; + + private bool IsFavorite => IsDataLoadedOk && IsLoggedIn && Favorites.HasValue && Favorites.Value.IsSuccess && Favorites.Value.Value.Words.ContainsKey(EeWord.ToLower()); }