Skip to content

Commit

Permalink
removed computed from catChild
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszjedrasik committed Jan 11, 2021
1 parent 73f36cb commit 62d9791
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/commercetools/theme/components/header/HeaderNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import { SfMegaMenu, SfMenuItem, SfList, SfBanner, SfLoader } from '@storefront-ui/vue';
import { useCategory } from '@vue-storefront/commercetools';
import { onSSR } from '@vue-storefront/core';
import { computed, ref } from '@vue/composition-api';
import { ref } from '@vue/composition-api';
import { rootCategoriesQuery } from '../../queries/topCategories';
import debounce from 'lodash.debounce';
Expand All @@ -69,8 +69,8 @@ export default {
if (currentCatSlug.value) return;
currentCatSlug.value = slug;
const catChild = computed(() => categories.value.find(category => category.slug === currentCatSlug.value));
emit('setOverlay', Boolean(catChild.value.childCount));
const catChild = categories.value.find(category => category.slug === currentCatSlug.value);
emit('setOverlay', Boolean(catChild.childCount));
subCategoriesSearch({ slug });
}, 200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import { SfMegaMenu, SfMenuItem, SfList } from '@storefront-ui/vue';
import { useCategory } from '<%= options.generate.replace.composables %>';
import { onSSR } from '@vue-storefront/core';
import { computed, ref } from '@vue/composition-api';
import { ref } from '@vue/composition-api';
export default {
name: 'HeaderNav',
Expand All @@ -62,8 +62,8 @@ export default {
if (currentCatSlug.value) return;
currentCatSlug.value = slug;
const catChild = computed(() => categories.value.find(category => category.slug === currentCatSlug.value));
emit('setOverlay', Boolean(catChild.value.childCount));
const catChild = categories.value.find(category => category.slug === currentCatSlug.value);
emit('setOverlay', Boolean(catChild.childCount));
};
const handleMouseLeave = () => {
Expand Down

0 comments on commit 62d9791

Please sign in to comment.