File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
app/code/Magento/Persistent/view/frontend/web/js/view Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -45,24 +45,15 @@ define([
45
45
* @param {Object } settings
46
46
* @constructor
47
47
*/
48
- 'Magento_Customer/js/customer-data' : function ( originFn , invalidateOptions ) {
49
- let date ,
50
- storage = $ . initNamespaceStorage ( 'mage-cache-storage' ) . localStorage ;
48
+ 'Magento_Customer/js/customer-data' : function ( originFn ) {
49
+ let date = new Date ( $ . localStorage . get ( 'mage-cache-timeout' ) ) ,
50
+ mageCacheSessId = $ . cookieStorage . isSet ( 'mage-cache-sessid' ) ;
51
51
52
- if ( new Date ( $ . localStorage . get ( 'mage-cache-timeout' ) ) < new Date ( ) ) {
53
- storage . removeAll ( ) ;
54
- this . reload ( [ 'persistent' , 'cart' ] , true ) ;
55
- }
56
- date = new Date ( Date . now ( ) + parseInt ( invalidateOptions . cookieLifeTime , 10 ) * 1000 ) ;
57
- $ . localStorage . set ( 'mage-cache-timeout' , date ) ;
58
-
59
- if ( ! $ . cookieStorage . isSet ( 'mage-cache-sessid' ) ) {
60
- $ . cookieStorage . set ( 'mage-cache-sessid' , true ) ;
61
- storage . removeAll ( ) ;
52
+ originFn ( ) ;
53
+ if ( window . persistent !== undefined && ( date < new Date ( ) || ! mageCacheSessId ) ) {
54
+ debugger ;
62
55
this . reload ( [ 'persistent' , 'cart' ] , true ) ;
63
56
}
64
- originFn ( ) ;
65
-
66
57
}
67
58
} ;
68
59
You can’t perform that action at this time.
0 commit comments