Skip to content

Commit

Permalink
Merge pull request #626 from amansinghbais/quick-fix
Browse files Browse the repository at this point in the history
Fixed: loader not dismissing in case of empty hard count
  • Loading branch information
ymaheshwari1 authored Jan 16, 2025
2 parents d373134 + 663255e commit 1b63056
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/views/CountDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ onIonViewDidEnter(async() => {
previousItem = itemsList.value[0]
await store.dispatch("product/currentProduct", itemsList.value[0])
barcodeInput.value?.$el?.setFocus();
initializeObserver()
emitter.emit("dismissLoader")
if(itemsList.value?.length) initializeObserver()
})
onIonViewDidLeave(async() => {
Expand Down Expand Up @@ -442,7 +442,7 @@ async function updateFilteredItems() {
store.dispatch("product/currentProduct", {});
}
await nextTick();
initializeObserver()
if(itemsList.value?.length) initializeObserver()
}
function initializeObserver() {
Expand Down
10 changes: 7 additions & 3 deletions src/views/HardCountDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ onIonViewDidEnter(async() => {
barcodeInputRef.value?.$el?.setFocus();
selectedCountUpdateType.value = defaultRecountUpdateBehaviour.value
window.addEventListener('beforeunload', handleBeforeUnload);
initializeObserver()
emitter.emit("dismissLoader")
if(itemsList.value?.length) initializeObserver()
})
onIonViewDidLeave(async() => {
Expand Down Expand Up @@ -328,7 +328,7 @@ async function handleSegmentChange() {
inputCount.value = ""
selectedCountUpdateType.value = defaultRecountUpdateBehaviour.value
await nextTick();
initializeObserver()
if(itemsList.value?.length) initializeObserver()
}
async function changeProduct(direction: string) {
Expand Down 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);
initializeObserver()
if(itemsList.value?.length) {
setTimeout(() => {
initializeObserver()
}, 0);
}
findProductFromIdentifier(queryString.value.trim());
return newItem;
}
Expand Down

0 comments on commit 1b63056

Please sign in to comment.