acquia_vwo-1.0.x-dev/js/user_opt.js
js/user_opt.js
(function ($, Drupal, drupalSettings) {
Drupal.behaviors.acquia_vwo_user_opt = {
attach: function attach(context, settings) {
const Once = once('acquia_vwo_user_opt', 'body', context);
if (Once.length === 0) {
return;
}
if (drupalSettings.user.vwo_user_opt == null) {
localStorage.removeItem('acquia_vwo_user_opt');
} else {
localStorage.setItem(
'acquia_vwo_user_opt',
drupalSettings.user.vwo_user_opt,
);
}
},
};
})(jQuery, Drupal, drupalSettings);
