File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
app/code/Magento/Customer/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,6 @@ define([
30
30
url . setBaseUrl ( window . BASE_URL ) ;
31
31
options . sectionLoadUrl = url . build ( 'customer/section/load' ) ;
32
32
33
- //TODO: remove global change, in this case made for initNamespaceStorage
34
- $ . cookieStorage . setConf ( {
35
- path : '/' ,
36
- expires : 1
37
- } ) ;
38
-
39
- storage = $ . initNamespaceStorage ( 'mage-cache-storage' ) . localStorage ;
40
- storageInvalidation = $ . initNamespaceStorage ( 'mage-cache-storage-section-invalidation' ) . localStorage ;
41
-
42
33
/**
43
34
* @param {Object } invalidateOptions
44
35
*/
@@ -222,6 +213,18 @@ define([
222
213
}
223
214
} ,
224
215
216
+ /**
217
+ * Storage init
218
+ */
219
+ initStorage : function ( ) {
220
+ $ . cookieStorage . setConf ( {
221
+ path : '/' ,
222
+ expires : new Date ( Date . now ( ) + parseInt ( options . cookieLifeTime , 10 ) * 1000 )
223
+ } ) ;
224
+ storage = $ . initNamespaceStorage ( 'mage-cache-storage' ) . localStorage ;
225
+ storageInvalidation = $ . initNamespaceStorage ( 'mage-cache-storage-section-invalidation' ) . localStorage ;
226
+ } ,
227
+
225
228
/**
226
229
* Retrieve the list of sections that has expired since last page reload.
227
230
*
@@ -357,6 +360,7 @@ define([
357
360
*/
358
361
'Magento_Customer/js/customer-data' : function ( settings ) {
359
362
options = settings ;
363
+ customerData . initStorage ( ) ;
360
364
invalidateCacheBySessionTimeOut ( settings ) ;
361
365
invalidateCacheByCloseCookieSession ( ) ;
362
366
customerData . init ( ) ;
You can’t perform that action at this time.
0 commit comments