Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: both the item change buttons becomes active after changing tab(#442) #491

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/views/CountDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ function updateFilteredItems() {
});
}
if (filteredItems.value.length > 0) {
const updatedProduct = Object.keys(product.value)?.length ? product.value : filteredItems.value[0]
// As we want to get the index of the product, if we directly store the product in the updatedProduct variable it does not return the index
// as both the object becomes different because of the reference, so if we have a product, then first finding it in the filtered list to have a common reference and then getting the index
const updatedProduct = Object.keys(product.value)?.length ? filteredItems.value.find((item) => item.productId === product.value.productId && item.importItemSeqId === product.value.importItemSeqId) : filteredItems.value[0]
store.dispatch("product/currentProduct", updatedProduct);
updateNavigationState(filteredItems.value.indexOf(updatedProduct));
} else {
Expand Down
Loading