fix: store value in the cookie file if a user decided to opt our from the warning/error messages

This commit is contained in:
ievgenii vdovenko 2025-06-17 11:53:38 +02:00
parent 8d60a35c68
commit ba0c55321c
2 changed files with 7 additions and 6 deletions

View file

@ -705,6 +705,9 @@ var storeUserSessionAttr = function (key, val) {
return false;
};
let setCookie = function (name, value, path = '/') {
document.cookie = `${name}=${encodeURIComponent(value)}; path=${path}`;
};
var getUserSessionAttr = function(key) {
var storeKey = templateContext.session_attrs;

View file

@ -125,15 +125,13 @@ c.template_context['attachment_store'] = {
ajaxPOST(url, postData, success, failure);
}
var hideLicenseWarning = function () {
var fingerprint = templateContext.session_attrs.license_fingerprint;
storeUserSessionAttr('rc_user_session_attr.hide_license_warning', fingerprint);
let hideLicenseWarning = function () {
setCookie('hide_license_warning', 'true');
$('#notifications').hide();
}
var hideLicenseError = function () {
var fingerprint = templateContext.session_attrs.license_fingerprint;
storeUserSessionAttr('rc_user_session_attr.hide_license_error', fingerprint);
let hideLicenseError = function () {
setCookie('hide_license_error', 'true');
$('#notifications').hide();
}