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([
4545 * @param {Object } settings
4646 * @constructor
4747 */
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' ) ;
5151
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 ;
6255 this . reload ( [ 'persistent' , 'cart' ] , true ) ;
6356 }
64- originFn ( ) ;
65-
6657 }
6758 } ;
6859
You can’t perform that action at this time.
0 commit comments