Skip to content

Commit 508cf5d

Browse files
committed
fix: reset history table loading state
1 parent 0e9ddc9 commit 508cf5d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/views/reorganize/TransferHistoryView.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ watch(
388388
// 获取历史记录数据,keep-alive 重新进入时可静默刷新,避免表格出现重新加载感。
389389
async function fetchData(page = currentPage.value, count = itemsPerPage.value, options: { silent?: boolean } = {}) {
390390
const requestSeed = ++fetchDataRequestSeed
391-
if (!options.silent) {
391+
const shouldShowLoading = !options.silent
392+
if (shouldShowLoading) {
392393
loading.value = true
393394
}
394395
@@ -418,7 +419,8 @@ async function fetchData(page = currentPage.value, count = itemsPerPage.value, o
418419
} catch (error) {
419420
console.error(error)
420421
} finally {
421-
if (requestSeed === fetchDataRequestSeed && !options.silent) {
422+
// 静默刷新可能会接管前一个可见请求,也需要负责清掉遗留的表格加载态。
423+
if (requestSeed === fetchDataRequestSeed && (shouldShowLoading || loading.value)) {
422424
loading.value = false
423425
}
424426
}

0 commit comments

Comments
 (0)