Skip to content

Commit fec4629

Browse files
author
Asa Schachar
authored
fix (project-js): Ensure method name is correct
- Ensure method name `clearOptlyLocalStorage` is correct. - Update styling
1 parent f4f6f2b commit fec4629

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
/*Exposing a window-level function to clear localStorage values who's key includes the substring 'optimizely'
2-
*/
3-
window.clearOptlyLocalStorage = function(){
4-
for (var key in window.localStorage){
5-
if(key.indexOf('optimizely') !== -1){
6-
window.localStorage.removeItem(key)
7-
}
1+
/**
2+
* Exposing a window-level function to clear localStorage values who's key includes the substring 'optimizely'
3+
*/
4+
window.clearOptlyLocalStorage = function() {
5+
for (var key in window.localStorage) {
6+
if (key.indexOf('optimizely') !== -1) {
7+
window.localStorage.removeItem(key)
88
}
9+
}
910
}
10-
//The function can be called from Optimizely Project JS based on an available boolean flag, such as a cookie's value
11+
12+
// The function can be called from Optimizely Project JS based on an available boolean flag, such as a cookie's value
1113
var should_clear = window.customer_storage_flag_boolean;
12-
if(should_clear){
13-
clearOptimizelyLocalStorage();
14+
if (should_clear) {
15+
clearOptlyLocalStorage();
1416
}

0 commit comments

Comments
 (0)