Fix record list autorefresh edge case

This commit is contained in:
Jože Fortun
2023-04-07 15:57:04 +02:00
parent 12fe6b8d5e
commit 2e5f90a309
2 changed files with 4 additions and 4 deletions
@@ -1034,7 +1034,7 @@ export default {
created () {
if (!this.inlineEditing) {
this.refreshBlock(this.refresh)
this.refreshBlock(this.refresh, false, true)
}
},
@@ -1486,7 +1486,7 @@ export default {
}
},
refresh (resetPagination = false, checkSelected = true) {
refresh (resetPagination = false, checkSelected = false) {
// Prevent refresh if records are selected or inline editing
if (checkSelected && (this.selected.length || this.inlineEdit.recordIDs.length)) return
@@ -101,11 +101,11 @@ export default {
* If reloading data does not refresh the page block
* You should attach :key="key" to it and increment it in the refreshFunction
*/
refreshBlock (refreshFunction) {
refreshBlock (refreshFunction, ...params) {
if (!this.autoRefreshEnabled || this.refreshInterval) return
const interval = setInterval(() => {
refreshFunction()
refreshFunction(...params)
}, this.options.refreshRate * 1000)
this.refreshInterval = interval