Skip to content

Commit

Permalink
fix: start index added to badge in progress carousel (#5668)
Browse files Browse the repository at this point in the history
  • Loading branch information
roger-in-kiva authored Nov 11, 2024
1 parent 7105bb0 commit f9c4054
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/MyKiva/BadgeInProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<KvCarousel
:key="`${badge.id}-carousel-${isLoading}-${loanDisplayCount}`"
class="kv-carousel tw-w-full md:tw-block tw-hidden"
:embla-options="{ loop: false }"
:embla-options="{ loop: false, startIndex: carouselIndex }"
:multiple-slides-visible="true"
slides-to-scroll="visible"
:slide-max-width="singleSlideWidth"
Expand Down Expand Up @@ -117,6 +117,7 @@ const {
const isLoading = ref(true);
const loanIds = ref();
const loadMoreClicked = ref(false);
const carouselIndex = ref(0);
const loanDisplayCount = computed(() => (loadMoreClicked.value ? 6 : 3));
const tierBadgeData = computed(() => getTierBadgeDataByLevel(props.badge, props.tier.level));
Expand Down Expand Up @@ -166,6 +167,7 @@ const onLoadMore = () => {
);
loadMoreClicked.value = true;
carouselIndex.value = 1;
} else {
$kvTrackEvent(
'portfolio',
Expand All @@ -180,6 +182,7 @@ const onLoadMore = () => {
};
watch(() => props.badge, () => {
carouselIndex.value = 0;
isLoading.value = true;
loanIds.value = [];
loadMoreClicked.value = false;
Expand Down

0 comments on commit f9c4054

Please sign in to comment.