mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
39 lines
727 B
JavaScript
39 lines
727 B
JavaScript
import { LINKED_ITEMS_DEFAULT_LOAD_COUNT } from '@baserow/modules/database/constants'
|
|
|
|
export default {
|
|
emits: ['refresh-row'],
|
|
|
|
props: {
|
|
row: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
value: {
|
|
type: Array,
|
|
required: false,
|
|
default: () => [],
|
|
},
|
|
},
|
|
computed: {
|
|
shouldFetchRow() {
|
|
return (
|
|
this.value?.length === LINKED_ITEMS_DEFAULT_LOAD_COUNT &&
|
|
!this.row._?.fullyLoaded
|
|
)
|
|
},
|
|
isFetchingRow() {
|
|
return this.row._?.fetching ?? false
|
|
},
|
|
},
|
|
watch: {
|
|
row: {
|
|
handler() {
|
|
if (this.shouldFetchRow && !this.isFetchingRow) {
|
|
this.$emit('refresh-row')
|
|
}
|
|
},
|
|
immediate: true,
|
|
},
|
|
},
|
|
}
|