From f7c4662e2b5f4c9fb9ce53f4664e8e43ef30f064 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 22 Sep 2019 09:36:28 +0200 Subject: [PATCH] Prevent error message spam when navigating away before the page has completely loaded --- public/js/grocy.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/js/grocy.js b/public/js/grocy.js index 1ffe0549..96a6b9f3 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -442,7 +442,10 @@ $(".user-setting-control").on("change", function() }, function(xhr) { - Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response) + if (!xhr.statusText.isEmpty()) + { + Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response) + } } ); });