N°7371 - Remembers the choice done in the popup that appears when saving public and private logs at the same time (#636)

This commit is contained in:
Anne-Catherine
2025-01-30 15:55:34 +01:00
committed by GitHub
parent f1594ad974
commit 8a604c643e
4 changed files with 12 additions and 24 deletions

View File

@@ -213,10 +213,14 @@ function SetUserPreference(sPreferenceCode, sPrefValue, bPersistent) {
} catch (err) {
sPreviousValue = undefined;
}
oUserPreferences[sPreferenceCode] = sPrefValue;
if (bPersistent && (sPrefValue != sPreviousValue)) {
ajax_request = $.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
{operation: 'set_pref', code: sPreferenceCode, value: sPrefValue}); // Make it persistent
return $.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
{operation: 'set_pref', code: sPreferenceCode, value: sPrefValue}, function (data) {
}).done(function() {
oUserPreferences[sPreferenceCode] = sPrefValue;
}); // Make it persistent
} else {
oUserPreferences[sPreferenceCode] = sPrefValue;
}
}