Skip to content

Commit 37f7847

Browse files
committed
Fixed: wrong button getting displayed in case of unmatched product (#528)
1 parent 40af5f4 commit 37f7847

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/views/HardCountDetail.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
<!--Product details-->
4242
<main :class="itemsList?.length ? 'product-detail' : ''">
43-
<template v-if="itemsList?.length">
43+
<template v-if="itemsList?.length && Object.keys(currentProduct)?.length">
4444
<div class="product" @scroll="onScroll">
4545
<div class="image ion-padding-top" v-for="item in itemsList" :key="item.importItemSeqId || item.scannedId" :data-product-id="item.productId" :data-seq="item.importItemSeqId" :id="isItemAlreadyAdded(item) ? `${item.productId}-${item.importItemSeqId}` : item.scannedId" :data-isMatching="item.isMatching" :data-scanned-id="item.scannedId">
4646
<Image :src="getProduct(item.productId)?.mainImageUrl" />

src/views/ProductItemList.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ async function navigateToDetail(item: any) {
7070
const element = document.getElementById(isItemAlreadyAdded(item) ? `${item.productId}-${item.importItemSeqId}` : item.scannedId);
7171
if (element) {
7272
element.scrollIntoView({ behavior: 'smooth' });
73+
} else {
74+
store.dispatch("product/currentProduct", item);
7375
}
7476
}, 0);
7577
}

0 commit comments

Comments
 (0)