@@ -60,34 +60,6 @@ const setDefaultLocale = async (i18n) => {
6060 await i18n . setLocale ( i18n . defaultLocale ) ;
6161} ;
6262
63- /**
64- * Prepare new cookie string based on app state.
65- *
66- * @param apiState {ConfigState}
67- * @param newStoreCode {string}
68- * @param currency {string}
69- * @returns {string }
70- */
71- const prepareNewCookieString = ( apiState : ConfigState , newStoreCode : string , currency : string ) => {
72- const customerTokenCookie = apiState . getCustomerToken ( ) ;
73- const cartIdCookie = apiState . getCartId ( ) ;
74-
75- let cookie = `vsf-store=${ newStoreCode } ; ` ;
76- cookie += `vsf-locale=${ newStoreCode } ; ` ;
77- cookie += `vsf-currency=${ currency } ; ` ;
78- cookie += `vsf-country=${ apiState . getCountry ( ) } ; ` ;
79-
80- if ( customerTokenCookie ) {
81- cookie += `vsf-customer=${ customerTokenCookie } ; ` ;
82- }
83-
84- if ( cartIdCookie ) {
85- cookie += `vsf-cart=${ cartIdCookie } ` ;
86- }
87-
88- return cookie ;
89- } ;
90-
9163export default async ( { app, route } : Context ) => {
9264 await app . $vsf . $magento . client . interceptors . request . use ( async ( request ) => {
9365 const { i18n } = app ;
@@ -110,9 +82,6 @@ export default async ({ app, route }: Context) => {
11082 apiState . setStore ( i18nCurrentLocaleCode ) ;
11183 apiState . setLocale ( i18nCurrentLocaleCode ) ;
11284 apiState . setCurrency ( currency ) ;
113-
114- // eslint-disable-next-line no-param-reassign
115- request . headers . cookie = prepareNewCookieString ( apiState , i18nCurrentLocaleCode , currency ) ;
11685 }
11786
11887 return request ;
0 commit comments