Optimized user settings save handling (fixes #1747)

This commit is contained in:
Bernd Bestel 2022-01-16 14:58:42 +01:00
parent e3808c71b9
commit dfc274643f
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -432,6 +432,11 @@ Grocy.FrontendHelpers.ShowGenericError = function(message, exception)
Grocy.FrontendHelpers.SaveUserSetting = function(settingsKey, value) Grocy.FrontendHelpers.SaveUserSetting = function(settingsKey, value)
{ {
if (Grocy.UserSettings[settingsKey] == value)
{
return;
}
Grocy.UserSettings[settingsKey] = value; Grocy.UserSettings[settingsKey] = value;
jsonData = {}; jsonData = {};
@ -443,10 +448,7 @@ Grocy.FrontendHelpers.SaveUserSetting = function(settingsKey, value)
}, },
function(xhr) function(xhr)
{ {
if (!xhr.statusText.isEmpty()) console.error(xhr);
{
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response)
}
} }
); );
} }