Skip to content

Commit

Permalink
Improved: added setTimeOut on adding product
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Jan 16, 2025
1 parent 577d1fc commit 663255e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/views/HardCountDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,11 @@ async function addProductToItemsList() {
const items = JSON.parse(JSON.stringify(cycleCountItems.value.itemList))
items.push(newItem);
await store.dispatch("count/updateCycleCountItems", items);
if(itemsList.value?.length) initializeObserver()
if(itemsList.value?.length) {
setTimeout(() => {
initializeObserver()
}, 0);
}
findProductFromIdentifier(queryString.value.trim());
return newItem;
}
Expand Down

0 comments on commit 663255e

Please sign in to comment.