Skip to content

Commit 4998ee5

Browse files
committed
added init
1 parent 40a32b8 commit 4998ee5

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

dist/breinify-api.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15718,6 +15718,10 @@ dependencyScope.jQuery = $;;
1571815718
return this.splitTestData;
1571915719
}
1572015720

15721+
// make sure the instance is initialized
15722+
Breinify.UTL.storage.init({});
15723+
15724+
// get the information from it
1572115725
this.splitTestData = Breinify.UTL.storage.get('splitTestData');
1572215726
if (this.splitTestData === null || !$.isPlainObject(this.splitTestData)) {
1572315727
this.splitTestData = {};
@@ -15778,7 +15782,10 @@ dependencyScope.jQuery = $;;
1577815782
});
1577915783
}
1578015784

15781-
// store the updated information and set it, it can only be modified here
15785+
/*
15786+
* Store the updated information and set it, it can only be modified here -
15787+
* must be initialized we called `getSplitTestData` previously.
15788+
*/
1578215789
Breinify.UTL.storage.update('splitTestData', 30 * 24 * 60, splitTestData);
1578315790
this.splitTestData = splitTestData;
1578415791
},

dist/breinify-api.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Breinify.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@
127127
return this.splitTestData;
128128
}
129129

130+
// make sure the instance is initialized
131+
Breinify.UTL.storage.init({});
132+
133+
// get the information from it
130134
this.splitTestData = Breinify.UTL.storage.get('splitTestData');
131135
if (this.splitTestData === null || !$.isPlainObject(this.splitTestData)) {
132136
this.splitTestData = {};
@@ -187,7 +191,10 @@
187191
});
188192
}
189193

190-
// store the updated information and set it, it can only be modified here
194+
/*
195+
* Store the updated information and set it, it can only be modified here -
196+
* must be initialized we called `getSplitTestData` previously.
197+
*/
191198
Breinify.UTL.storage.update('splitTestData', 30 * 24 * 60, splitTestData);
192199
this.splitTestData = splitTestData;
193200
},

0 commit comments

Comments
 (0)