25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
761 B

  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. define([
  6. 'jquery',
  7. 'Magento_Customer/js/customer-data'
  8. ], function ($, customerData) {
  9. 'use strict';
  10. return function () {
  11. var customer;
  12. // When the session is available, this customer menu will be available
  13. if ($('.customer-menu').length > 0) {
  14. customer = customerData.get('customer');
  15. customerData.getInitCustomerData().done(function () {
  16. // Check if the customer data is set in local storage, if not reload data from server
  17. if (!customer().firstname) {
  18. customerData.reload([], false);
  19. }
  20. });
  21. }
  22. };
  23. });