diff --git a/public/viewjs/components/batterycard.js b/public/viewjs/components/batterycard.js index 6533628d..a0626745 100644 --- a/public/viewjs/components/batterycard.js +++ b/public/viewjs/components/batterycard.js @@ -2,6 +2,11 @@ Grocy.Components.BatteryCard = {}; Grocy.Components.BatteryCard.Refresh = function(batteryId) { + if (!$(".batterycard").is(":visible")) + { + return; + } + Grocy.Api.Get('batteries/' + batteryId, function(batteryDetails) { diff --git a/public/viewjs/components/chorecard.js b/public/viewjs/components/chorecard.js index ca4a38a1..4ccecf1d 100644 --- a/public/viewjs/components/chorecard.js +++ b/public/viewjs/components/chorecard.js @@ -2,6 +2,11 @@ Grocy.Components.ChoreCard = {}; Grocy.Components.ChoreCard.Refresh = function(choreId) { + if (!$(".chorecard").is(":visible")) + { + return; + } + Grocy.Api.Get('chores/' + choreId, function(choreDetails) { diff --git a/public/viewjs/components/productcard.js b/public/viewjs/components/productcard.js index dba979cc..8adf1e74 100644 --- a/public/viewjs/components/productcard.js +++ b/public/viewjs/components/productcard.js @@ -2,6 +2,11 @@ Grocy.Components.ProductCard = {}; Grocy.Components.ProductCard.Refresh = function(productId) { + if (!$(".productcard").is(":visible")) + { + return; + } + Grocy.Api.Get('stock/products/' + productId, function(productDetails) {