mirror of
https://github.com/grocy/grocy.git
synced 2026-03-27 23:29:25 +01:00
Optimized user settings save handling (fixes #1747)
This commit is contained in:
parent
e3808c71b9
commit
dfc274643f
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user