Skip to content

Commit 6515b88

Browse files
authored
fix(nag): make sure value is string for all storage engines
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
1 parent 0533782 commit 6515b88

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/definitions/modules/nag.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ $.fn.nag = function(parameters) {
6565

6666
initialize: function() {
6767
module.verbose('Initializing element');
68+
if(typeof settings.value !== 'string') {
69+
settings.value = JSON.stringify(settings.value);
70+
}
6871
storage = module.get.storage();
6972
$module
7073
.on('click' + eventNamespace, selector.close, module.dismiss)

0 commit comments

Comments
 (0)