Skip to content

Commit

Permalink
fix resource table pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
omohokcoj committed Apr 29, 2023
1 parent 2b84297 commit c2ed1e3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions ui/src/data_resources/components/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ export default {
emits: ['click-resize', 'click-menu', 'action-applied'],
data () {
return {
isLoading: false,
isReloading: false,
isLoading: true,
isReloading: true,
isDownloadLoading: false,
rows: [],
sortParams: {},
Expand Down Expand Up @@ -379,11 +379,6 @@ export default {
this.assignCachedItemsCount()
this.assignCachedRows()
if (!this.rows.length) {
this.isLoading = true
this.isReloading = true
}
this.loadDataAndCount({ loading: !this.rows.length }).then(() => {
if (typeof history.state.tableScrollTop === 'number') {
this.$nextTick(() => {
Expand Down Expand Up @@ -574,7 +569,9 @@ export default {
}).then((result) => {
this.paginationParams.total = result.data.meta.count
itemsCountCache.set(this.itemsCountCacheKey, result.data.meta.count)
this.$nextTick(() => {
itemsCountCache.set(this.itemsCountCacheKey, result.data.meta.count)
})
}).catch((error) => {
console.error(error)
})
Expand Down Expand Up @@ -626,7 +623,9 @@ export default {
}).then((result) => {
this.rows = result.data.data
rowsCache.set(this.rowsCacheKey, result.data.data)
this.$nextTick(() => {
rowsCache.set(this.rowsCacheKey, result.data.data)
})
}).catch((error) => {
if (error.response) {
this.$Message.error(truncate(error.response.data.errors.join('\n'), 70))
Expand Down

0 comments on commit c2ed1e3

Please sign in to comment.