Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -315,7 +315,7 @@ import { useProductPricingStore } from 'src/stores/ProductPricingStore'
|
||||
|
||||
const store = useProductPricingStore()
|
||||
const FETCH_LIMIT = 500
|
||||
const currentOffset = ref(0)
|
||||
const nextCursor = ref('')
|
||||
const loadingMore = ref(false)
|
||||
|
||||
const usdToTry = 38.25
|
||||
@@ -852,14 +852,14 @@ function clearAllCurrencies () {
|
||||
}
|
||||
|
||||
async function fetchChunk ({ reset = false } = {}) {
|
||||
const offset = reset ? 0 : currentOffset.value
|
||||
const afterProductCode = reset ? '' : nextCursor.value
|
||||
const result = await store.fetchRows({
|
||||
limit: FETCH_LIMIT,
|
||||
offset,
|
||||
afterProductCode,
|
||||
append: !reset
|
||||
})
|
||||
const fetched = Number(result?.fetched) || 0
|
||||
currentOffset.value = offset + fetched
|
||||
nextCursor.value = String(result?.nextCursor || '')
|
||||
return fetched
|
||||
}
|
||||
|
||||
@@ -894,7 +894,7 @@ async function reloadData () {
|
||||
console.info('[product-pricing][ui] reload:start', {
|
||||
at: new Date(startedAt).toISOString()
|
||||
})
|
||||
currentOffset.value = 0
|
||||
nextCursor.value = ''
|
||||
await fetchChunk({ reset: true })
|
||||
await ensureEnoughVisibleRows(120, 6)
|
||||
console.info('[product-pricing][ui] reload:done', {
|
||||
|
||||
Reference in New Issue
Block a user