mirror of
https://github.com/grocy/grocy.git
synced 2025-08-28 17:10:11 +00:00
Optimized user settings save handling (fixes #1747)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user