@@ -198,13 +198,11 @@ define([
198
198
* Customer data initialization
199
199
*/
200
200
init : function ( ) {
201
- var countryData ,
202
- privateContentVersion = 'private_content_version' ,
201
+ var privateContentVersion = 'private_content_version' ,
203
202
privateContent = $ . cookieStorage . get ( privateContentVersion ) ,
204
203
localPrivateContent = $ . localStorage . get ( privateContentVersion ) ,
205
204
needVersion = 'need_version' ,
206
- expiredSectionNames = this . getExpiredSectionNames ( ) ,
207
- isLoading = false ;
205
+ expiredSectionNames = this . getExpiredSectionNames ( ) ;
208
206
209
207
if ( privateContent &&
210
208
! $ . cookieStorage . isSet ( privateContentVersion ) &&
@@ -213,7 +211,6 @@ define([
213
211
$ . cookieStorage . set ( privateContentVersion , needVersion ) ;
214
212
$ . localStorage . set ( privateContentVersion , needVersion ) ;
215
213
this . reload ( [ ] , false ) ;
216
- isLoading = true ;
217
214
} else if ( localPrivateContent !== privateContent ) {
218
215
if ( ! $ . cookieStorage . isSet ( privateContentVersion ) ) {
219
216
privateContent = needVersion ;
@@ -224,7 +221,6 @@ define([
224
221
buffer . notify ( sectionName , sectionData ) ;
225
222
} ) ;
226
223
this . reload ( [ ] , false ) ;
227
- isLoading = true ;
228
224
} else if ( expiredSectionNames . length > 0 ) {
229
225
_ . each ( dataProvider . getFromStorage ( storage . keys ( ) ) , function ( sectionData , sectionName ) {
230
226
buffer . notify ( sectionName , sectionData ) ;
@@ -239,14 +235,6 @@ define([
239
235
this . reload ( storageInvalidation . keys ( ) , false ) ;
240
236
}
241
237
}
242
-
243
- if ( ! _ . isEmpty ( privateContent ) ) {
244
- countryData = this . get ( 'directory-data' ) ;
245
-
246
- if ( _ . isEmpty ( countryData ( ) ) && ! isLoading ) {
247
- customerData . reload ( [ 'directory-data' ] , false ) ;
248
- }
249
- }
250
238
} ,
251
239
252
240
/**
@@ -332,6 +320,9 @@ define([
332
320
} ,
333
321
334
322
/**
323
+ * Avoid using this function directly 'cause of possible performance drawbacks.
324
+ * Each customer section reload brings new non-cached ajax request.
325
+ *
335
326
* @param {Array } sectionNames
336
327
* @param {Boolean } forceNewSectionTimestamp
337
328
* @return {* }
0 commit comments