mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00: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)
|
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user