Skip to content

Commit a459e5b

Browse files
authored
Merge pull request #287 from BrainWise-DEV/fix/pos-j-bugs
fix: improve customer dialog behavior by adding nextTick and removing unnecessary console log
2 parents e7efc51 + c72894f commit a459e5b

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

POS/src/components/sale/CreateCustomerDialog.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ const sellingSettingsResource = createResource({
385385
auto: false,
386386
onError: (err) => log.error("Error loading Selling Settings", err),
387387
})
388-
console.log(sellingSettingsResource);
389388
390389
function pickDefault(settingsValue, list, fallbackFn = null) {
391390
if (settingsValue && list.includes(settingsValue)) return settingsValue
@@ -575,19 +574,15 @@ watch(showCountryDropdown, async (isOpen) => {
575574
watch(
576575
() => props.modelValue,
577576
async (isOpen) => {
578-
show.value = isOpen
579577
isOpen ? await loadDialogData() : resetForm()
580578
}
581579
)
582580
583-
watch(show, (val) => emit("update:modelValue", val))
584-
585581
// =============================================================================
586582
// Lifecycle Hooks
587583
// =============================================================================
588584
589585
onMounted(() => {
590-
loadDialogData()
591586
document.addEventListener("click", handleClickOutside)
592587
})
593588

POS/src/components/sale/CustomerDialog.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
import { useCustomerSearchStore } from "@/stores/customerSearch"
184184
import { Button, Dialog } from "frappe-ui"
185185
import { storeToRefs } from "pinia"
186-
import { computed, onMounted, ref, watch } from "vue"
186+
import { computed, nextTick, onMounted, ref, watch } from "vue"
187187
import CreateCustomerDialog from "./CreateCustomerDialog.vue"
188188
189189
const props = defineProps({
@@ -277,7 +277,9 @@ function selectCustomer(customer) {
277277
show.value = false
278278
}
279279
280-
function createNewCustomer() {
280+
async function createNewCustomer() {
281+
show.value = false
282+
await nextTick()
281283
showCreateDialog.value = true
282284
}
283285

0 commit comments

Comments
 (0)