diff --git a/.eslintrc.js b/.eslintrc.js index 00e852c11..cf60fd91d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,7 +29,4 @@ module.exports = { '@vue-storefront/eslint-config-vue', '@vue-storefront/eslint-config-jest', ], - rules: { - "@typescript-eslint/no-floating-promises": "off" - } } diff --git a/packages/composables/src/factories/useStoreFactory.ts b/packages/composables/src/factories/useStoreFactory.ts index 7f4ea7a5f..318f1ff4b 100644 --- a/packages/composables/src/factories/useStoreFactory.ts +++ b/packages/composables/src/factories/useStoreFactory.ts @@ -38,7 +38,7 @@ export function useStoreFactory): Promise => { loading.value = true; try { - _factoryParams.change(store); + await _factoryParams.change(store); } finally { loading.value = false; } diff --git a/packages/theme/components/CurrencySelector.vue b/packages/theme/components/CurrencySelector.vue index e834cd773..46f4f7726 100644 --- a/packages/theme/components/CurrencySelector.vue +++ b/packages/theme/components/CurrencySelector.vue @@ -104,7 +104,7 @@ export default defineComponent({ const isCurrencyModalOpen = ref(false); - const availableCurrencies = computed(() => currencies.value?.available_currency_codes || []); + const availableCurrencies = computed(() => currencies.value?.available_currency_codes); return { currentCurrencySymbol, diff --git a/packages/theme/composables/useMagentoConfiguration.ts b/packages/theme/composables/useMagentoConfiguration.ts index bbda83fcc..53680b5d9 100644 --- a/packages/theme/composables/useMagentoConfiguration.ts +++ b/packages/theme/composables/useMagentoConfiguration.ts @@ -44,7 +44,7 @@ export const useMagentoConfiguration: UseMagentoConfiguration = () => { const selectedStore = computed(() => app.$cookies.get(cookieNames.storeCookieName)); - const loadConfiguration: (params: { updateCookies: boolean; updateLocale: boolean; }) => void = (params = { + const loadConfiguration: (params: { updateCookies: boolean; updateLocale: boolean; }) => Promise = async (params = { updateCookies: false, updateLocale: false, }) => { diff --git a/packages/theme/layouts/default.vue b/packages/theme/layouts/default.vue index 814a31e63..46255dcf4 100644 --- a/packages/theme/layouts/default.vue +++ b/packages/theme/layouts/default.vue @@ -56,11 +56,12 @@ export default defineComponent({ setup() { const route = useRoute(); const { load: loadUser } = useUser(); + const { loadConfiguration } = useMagentoConfiguration(); - onMounted(() => { - loadConfiguration(); - loadUser(); + onSSR(async () => { + await loadConfiguration(); + await loadUser(); }); return {