Skip to content

Commit

Permalink
fix(nag): make sure value is string for all storage engines
Browse files Browse the repository at this point in the history
The cookie storage engine does only support string values. This PR adjusts a given value and converts it to string in case a boolean/object/array/null/etc. is given, so it's independent to any storage engine
  • Loading branch information
lubber-de authored Nov 16, 2022
1 parent 0533782 commit 6515b88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/definitions/modules/nag.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ $.fn.nag = function(parameters) {

initialize: function() {
module.verbose('Initializing element');
if(typeof settings.value !== 'string') {
settings.value = JSON.stringify(settings.value);
}
storage = module.get.storage();
$module
.on('click' + eventNamespace, selector.close, module.dismiss)
Expand Down

0 comments on commit 6515b88

Please sign in to comment.