Skip to content

Commit

Permalink
🐛 Fix linkMedium already defined
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt committed Nov 8, 2024
1 parent 7f2a92f commit b9364e4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 26 deletions.
5 changes: 1 addition & 4 deletions src/components/NFTBook/ItemCardV2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default {
type: Boolean,
default: true,
},
medium: {
linkMedium: {
type: String,
default: '',
},
Expand All @@ -78,9 +78,6 @@ export default {
};
},
computed: {
linkMedium() {
return this.medium || undefined;
},
classId() {
return this.itemId.startsWith('likenft1') ? this.itemId : '';
},
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/nft-or-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
collectionId: this.collectionId,
},
query: {
ll_medium: this.linkMedium,
ll_medium: this.mixinLinkMedium,
},
})
: this.localeLocation({
Expand All @@ -82,7 +82,7 @@ export default {
classId: this.classId,
},
query: {
ll_medium: this.linkMedium,
ll_medium: this.mixinLinkMedium,
},
});
},
Expand Down
12 changes: 8 additions & 4 deletions src/mixins/utm.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ export default {
return {
utmCampaign: this.$route.query.utm_campaign,
utmSource: this.$route.query.utm_source,
utmMedium: this.$route.query.utm_medium || this.linkMedium,
utmMedium: this.$route.query.utm_medium || this.mixinLinkMedium,
documentReferrer: '',
fbClickId: this.formattedFbcQs,
};
},
computed: {
linkMedium() {
return this.$route.query.ll_medium;
mixinLinkMedium() {
return (
this.$route.query.ll_medium ||
// NOTE: To be injected by the mixin user
this.linkMedium
);
},
gadClickId() {
return this.$route.query.gclid;
Expand All @@ -37,7 +41,7 @@ export default {
this.storeUTMToSessionStorage();
this.getFbClickIdFromCookie();
// TODO: split linkMedium into a new separate field
this.utmMedium = this.utmMedium || this.linkMedium;
this.utmMedium = this.utmMedium || this.mixinLinkMedium;
},
methods: {
setUTMProps({ utmCampaign, utmSource, utmMedium }) {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
:cover-resize="300"
:is-link-disabled="stickyBookstoreItem.isMultiple"
:is-lazy-loaded="false"
medium="index_sticky_item"
link-medium="index_sticky_item"
@click-cover="handleClickItem($event, stickyBookstoreItem)"
/>
</div>
Expand All @@ -422,7 +422,7 @@
class-cover-frame-aspect-ratio="min-h-[360px] laptop:min-h-[0] aspect-[4/5]"
:cover-resize="300"
:is-link-disabled="item.isMultiple"
medium="index_grid_item"
link-medium="index_grid_item"
@click-cover="handleClickItem($event, item)"
/>
</li>
Expand Down Expand Up @@ -454,7 +454,7 @@
<NFTBookItemCardV2
:item-id="item.classId"
class-cover-frame-aspect-ratio="aspect-[4/5]"
medium="index_grid_item_swiper"
link-medium="index_grid_item_swiper"
@click-cover="handleClickItem($event, item)"
/>
</SwiperSlide>
Expand Down
17 changes: 4 additions & 13 deletions src/pages/store/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
:item-id="item.classId"
class-cover-frame-aspect-ratio="aspect-[4/5]"
:is-link-disabled="item.isMultiple"
:medium="linkMedium"
:link-medium="linkMedium"
@click-cover="handleClickItem($event, item)"
/>
</li>
Expand Down Expand Up @@ -719,18 +719,9 @@ export default {
return baseUrl;
},
linkMedium() {
const {
query: { ll_medium: qsMedium, tag, q },
} = this.$route;
if (qsMedium) {
return qsMedium;
}
if (tag) {
return `tag-${tag}`;
}
if (q) {
return 'search';
}
const { tag, q } = this.$route.query;
if (tag) return `tag-${tag}`;
if (q) return 'search';
return 'listing';
},
// Price filter related
Expand Down

0 comments on commit b9364e4

Please sign in to comment.