diff --git a/resources/scripts/admin/views/estimates/View.vue b/resources/scripts/admin/views/estimates/View.vue index 6d3f624b..ba4bad9a 100644 --- a/resources/scripts/admin/views/estimates/View.vue +++ b/resources/scripts/admin/views/estimates/View.vue @@ -361,7 +361,7 @@ function hasActiveUrl(id) { return route.params.id == id } -async function loadEstimates(params, isScroll = false) { +async function loadEstimates(params, fromScrollListener = false) { if (isLoading.value) { return } @@ -376,21 +376,21 @@ async function loadEstimates(params, isScroll = false) { currentPageNumber.value = params ? params.page : 1 lastPageNumber.value = response.data.meta.last_page - let isEstimateExist = estimateList.value.find( + let estimateFound = estimateList.value.find( (est) => est.id == route.params.id ) if ( - isScroll == false && - !isEstimateExist && + fromScrollListener == false && + !estimateFound && currentPageNumber.value < lastPageNumber.value ) { loadEstimates({ page: ++currentPageNumber.value }) } - if (isEstimateExist) { + if (estimateFound) { setTimeout(() => { - if (isScroll == false) { + if (fromScrollListener == false) { scrollToEstimate() } }, 500) @@ -402,11 +402,11 @@ function scrollToEstimate() { if (el) { el.scrollIntoView({ behavior: 'smooth' }) el.classList.add('shake') - addScrollListner() + addScrollListener() } } -function addScrollListner() { +function addScrollListener() { estimateListSection.value.addEventListener('scroll', (ev) => { if ( ev.target.scrollTop > 0 && diff --git a/resources/scripts/admin/views/expenses/Create.vue b/resources/scripts/admin/views/expenses/Create.vue index a6908d04..1572196d 100644 --- a/resources/scripts/admin/views/expenses/Create.vue +++ b/resources/scripts/admin/views/expenses/Create.vue @@ -416,8 +416,8 @@ function onCurrencyChange(v) { async function searchCategory(search) { let res = await categoryStore.fetchCategories({ search }) if(res.data.data.length>0 && categoryStore.editCategory) { - let checkCategoryExist = res.data.data.find((c) => c.id==categoryStore.editCategory.id) - if(!checkCategoryExist) { + let categoryFound = res.data.data.find((c) => c.id==categoryStore.editCategory.id) + if(!categoryFound) { let edit_category = Object.assign({}, categoryStore.editCategory) res.data.data.unshift(edit_category) } @@ -428,8 +428,8 @@ async function searchCategory(search) { async function searchCustomer(search) { let res = await customerStore.fetchCustomers({ search }) if(res.data.data.length>0 && customerStore.editCustomer) { - let checkCustomerExist = res.data.data.find((c) => c.id==customerStore.editCustomer.id) - if(!checkCustomerExist) { + let customerFound = res.data.data.find((c) => c.id==customerStore.editCustomer.id) + if(!customerFound) { let edit_customer = Object.assign({}, customerStore.editCustomer) res.data.data.unshift(edit_customer) } @@ -463,7 +463,7 @@ async function loadData() { customerStore.editCustomer = expenseData.data.data.customer } } - + } else if (route.query.customer) { expenseStore.currentExpense.customer_id = route.query.customer } diff --git a/resources/scripts/admin/views/invoices/View.vue b/resources/scripts/admin/views/invoices/View.vue index d9f8607a..875b282d 100644 --- a/resources/scripts/admin/views/invoices/View.vue +++ b/resources/scripts/admin/views/invoices/View.vue @@ -110,7 +110,7 @@ function hasActiveUrl(id) { return route.params.id == id } -async function loadInvoices(params, isScroll = false) { +async function loadInvoices(params, fromScrollListener = false) { if (isLoading.value) { return } @@ -125,21 +125,21 @@ async function loadInvoices(params, isScroll = false) { currentPageNumber.value = params ? params.page : 1 lastPageNumber.value = response.data.meta.last_page - let isInvoiceExist = invoiceList.value.find( + let invoiceFound = invoiceList.value.find( (inv) => inv.id == route.params.id ) if ( - isScroll == false && - !isInvoiceExist && + fromScrollListener == false && + !invoiceFound && currentPageNumber.value < lastPageNumber.value ) { loadInvoices({ page: ++currentPageNumber.value }) } - if (isInvoiceExist) { + if (invoiceFound) { setTimeout(() => { - if (isScroll == false) { + if (fromScrollListener == false) { scrollToInvoice() } }, 500) @@ -151,11 +151,11 @@ function scrollToInvoice() { if (el) { el.scrollIntoView({ behavior: 'smooth' }) el.classList.add('shake') - addScrollListner() + addScrollListener() } } -function addScrollListner() { +function addScrollListener() { invoiceListSection.value.addEventListener('scroll', (ev) => { if ( ev.target.scrollTop > 0 && diff --git a/resources/scripts/admin/views/payments/View.vue b/resources/scripts/admin/views/payments/View.vue index de58ba11..4f9fcbf5 100644 --- a/resources/scripts/admin/views/payments/View.vue +++ b/resources/scripts/admin/views/payments/View.vue @@ -337,7 +337,7 @@ function hasAbilities() { const dialogStore = useDialogStore() -async function loadPayments(params, isScroll = false) { +async function loadPayments(params, fromScrollListener = false) { if (isLoading.value) { return } @@ -352,21 +352,21 @@ async function loadPayments(params, isScroll = false) { currentPageNumber.value = params ? params.page : 1 lastPageNumber.value = response.data.meta.last_page - let isPaymentExist = paymentList.value.find( + let paymentFound = paymentList.value.find( (paym) => paym.id == route.params.id ) if ( - isScroll == false && - !isPaymentExist && + fromScrollListener == false && + !paymentFound && currentPageNumber.value < lastPageNumber.value ) { loadPayments({ page: ++currentPageNumber.value }) } - if (isPaymentExist) { + if (paymentFound) { setTimeout(() => { - if (isScroll == false) { + if (fromScrollListener == false) { scrollToPayment() } }, 500) @@ -392,11 +392,11 @@ function scrollToPayment() { if (el) { el.scrollIntoView({ behavior: 'smooth' }) el.classList.add('shake') - addScrollListner() + addScrollListener() } } -function addScrollListner() { +function addScrollListener() { paymentListSection.value.addEventListener('scroll', (ev) => { if ( ev.target.scrollTop > 0 && diff --git a/resources/scripts/admin/views/recurring-invoices/partials/RecurringInvoiceViewSidebar.vue b/resources/scripts/admin/views/recurring-invoices/partials/RecurringInvoiceViewSidebar.vue index cdda4041..2d1b0d95 100644 --- a/resources/scripts/admin/views/recurring-invoices/partials/RecurringInvoiceViewSidebar.vue +++ b/resources/scripts/admin/views/recurring-invoices/partials/RecurringInvoiceViewSidebar.vue @@ -37,7 +37,7 @@ function hasActiveUrl(id) { return route.params.id == id } -async function loadRecurringInvoices(params, isScroll = false) { +async function loadRecurringInvoices(params, fromScrollListener = false) { if (isLoading.value) { return } @@ -52,21 +52,21 @@ async function loadRecurringInvoices(params, isScroll = false) { currentPageNumber.value = params ? params.page : 1 lastPageNumber.value = response.data.meta.last_page - let isInvoiceExist = invoiceList.value.find( + let invoiceFound = invoiceList.value.find( (inv) => inv.id == route.params.id ) if ( - isScroll == false && - !isInvoiceExist && + fromScrollListener == false && + !invoiceFound && currentPageNumber.value < lastPageNumber.value ) { loadRecurringInvoices({ page: ++currentPageNumber.value }) } - if (isInvoiceExist) { + if (invoiceFound) { setTimeout(() => { - if (isScroll == false) { + if (fromScrollListener == false) { scrollToRecurringInvoice() } }, 500) @@ -78,11 +78,11 @@ function scrollToRecurringInvoice() { if (el) { el.scrollIntoView({ behavior: 'smooth' }) el.classList.add('shake') - addScrollListner() + addScrollListener() } } -function addScrollListner() { +function addScrollListener() { invoiceListSection.value.addEventListener('scroll', (ev) => { if ( ev.target.scrollTop > 0 && diff --git a/resources/scripts/components/base/BaseCustomerSelectInput.vue b/resources/scripts/components/base/BaseCustomerSelectInput.vue index f2b84d61..79d166dd 100644 --- a/resources/scripts/components/base/BaseCustomerSelectInput.vue +++ b/resources/scripts/components/base/BaseCustomerSelectInput.vue @@ -83,8 +83,8 @@ async function searchCustomers(search) { let res = await customerStore.fetchCustomers(data) if(res.data.data.length>0 && customerStore.editCustomer) { - let checkCustomerExist = res.data.data.find((c) => c.id==customerStore.editCustomer.id) - if(!checkCustomerExist) { + let customerFound = res.data.data.find((c) => c.id==customerStore.editCustomer.id) + if(!customerFound) { let edit_customer = Object.assign({}, customerStore.editCustomer) res.data.data.unshift(edit_customer) }