Skip to content

Commit

Permalink
fix(theme): fix add to wishlist button on catgory listing view for a …
Browse files Browse the repository at this point in the history
…mobile devices (#554)

Co-authored-by: Bartosz Herba <[email protected]>
  • Loading branch information
2 people authored and Frodigo committed Feb 15, 2022
1 parent efb6506 commit 4719fe1
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/theme/pages/Category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@
</template>
<template #actions>
<SfButton
class="sf-button--text desktop-only"
style="margin: 0 0 1rem auto; display: block"
class="sf-button--text products__product-card-horizontal__add-to-wishlist"
@click="addItemToWishlist(product)"
>
{{ isInWishlist({product}) ? $t('Remove from Wishlist') : $t('Save for later') }}
Expand Down Expand Up @@ -439,7 +438,6 @@ import cacheControl from '~/helpers/cacheControl';
import { useAddToCart } from '~/helpers/cart/addToCart';
import CategorySidebarMenu from '~/components/Category/CategorySidebarMenu';
// TODO(addToCart qty, horizontal): https://github.com/vuestorefront/storefront-ui/issues/1606
export default defineComponent({
name: 'CategoryPage',
Expand Down Expand Up @@ -647,16 +645,12 @@ export default defineComponent({
const tags = [{ prefix: CacheTagPrefix.View, value: 'category' }];
// eslint-disable-next-line no-underscore-dangle
const productTags = products.value.map((product) => {
return { prefix: CacheTagPrefix.Product, value: product.uid };
});
const productTags = products.value.map((product) => ({ prefix: CacheTagPrefix.Product, value: product.uid }));
const categoriesTags = categoryTree.value.items.map((category) => {
return { prefix: CacheTagPrefix.Category, value: category.slug };
});
const categoriesTags = categoryTree.value.items.map((category) => ({ prefix: CacheTagPrefix.Category, value: category.slug }));
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
addTags(tags.concat(productTags, categoriesTags));
addTags([...tags, ...productTags, ...categoriesTags]);
});
const { getMagentoImage, imageSizes } = useImage();
Expand Down

0 comments on commit 4719fe1

Please sign in to comment.