From dfc274643fdea4fd025cec4ac6085c1bdaacaa9a Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 16 Jan 2022 14:58:42 +0100 Subject: [PATCH] Optimized user settings save handling (fixes #1747) --- public/js/grocy.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/js/grocy.js b/public/js/grocy.js index 8b3123af..55bb880e 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -432,6 +432,11 @@ Grocy.FrontendHelpers.ShowGenericError = function(message, exception) Grocy.FrontendHelpers.SaveUserSetting = function(settingsKey, value) { + if (Grocy.UserSettings[settingsKey] == value) + { + return; + } + Grocy.UserSettings[settingsKey] = value; jsonData = {}; @@ -443,10 +448,7 @@ Grocy.FrontendHelpers.SaveUserSetting = function(settingsKey, value) }, function(xhr) { - if (!xhr.statusText.isEmpty()) - { - Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response) - } + console.error(xhr); } ); }