diff --git a/ShoppingAssistantWebClient.Web/Pages/Cards.razor b/ShoppingAssistantWebClient.Web/Pages/Cards.razor index d5064d9..1bc92c2 100644 --- a/ShoppingAssistantWebClient.Web/Pages/Cards.razor +++ b/ShoppingAssistantWebClient.Web/Pages/Cards.razor @@ -1,39 +1,11 @@ @page "/cards/{wishlistName}/{chatId}" -@inject IJSRuntime JSRuntime @inject NavigationManager navigationManager; - -
@@ -41,20 +13,27 @@

@wishlistName

-
+
@if (Products != null && Products.Count != 0 && currentProduct != Products.Count && currentProduct >= 0) {
- @for(int i = 0; i < Products[currentProduct].ImagesUrls.Length && i < 3; i++) { - string image = Products[currentProduct].ImagesUrls[i]; - if (currentImage == image) { - product image + @if(Products[currentProduct].ImagesUrls.Length > 0) { + @for(int i = 0; i < Products[currentProduct].ImagesUrls.Length && i < 3; i++) { + string image = Products[currentProduct].ImagesUrls[i]; + if (currentImage == image) { + product image + } } + next image + previous image + } + else + { + product image } - next image - previous image +
@for (var i = 0; i < Products[currentProduct].ImagesUrls.Length && i < 3; i++) { @@ -99,10 +78,6 @@
- if(!isProductsNull) { - isProductsNull = true; - StateHasChanged(); - } } else {