fix(账号管理): 移除调度切换后的冗余列表刷新
切换账号调度状态后,updateSchedulableInList 已完成局部更新, 无需再调用 load() 刷新整个列表。此修改减少不必要的 API 请求, 避免 UI 闪烁。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -357,9 +357,6 @@ const handleBulkToggleSchedulable = async (schedulable: boolean) => {
|
|||||||
} else {
|
} else {
|
||||||
selIds.value = hasIds ? [] : accountIds
|
selIds.value = hasIds ? [] : accountIds
|
||||||
}
|
}
|
||||||
load().catch((error) => {
|
|
||||||
console.error('Failed to refresh accounts:', error)
|
|
||||||
})
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to bulk toggle schedulable:', error)
|
console.error('Failed to bulk toggle schedulable:', error)
|
||||||
appStore.showError(t('common.error'))
|
appStore.showError(t('common.error'))
|
||||||
@@ -383,9 +380,6 @@ const handleToggleSchedulable = async (a: Account) => {
|
|||||||
try {
|
try {
|
||||||
const updated = await adminAPI.accounts.setSchedulable(a.id, nextSchedulable)
|
const updated = await adminAPI.accounts.setSchedulable(a.id, nextSchedulable)
|
||||||
updateSchedulableInList([a.id], updated?.schedulable ?? nextSchedulable)
|
updateSchedulableInList([a.id], updated?.schedulable ?? nextSchedulable)
|
||||||
load().catch((error) => {
|
|
||||||
console.error('Failed to refresh accounts:', error)
|
|
||||||
})
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to toggle schedulable:', error)
|
console.error('Failed to toggle schedulable:', error)
|
||||||
appStore.showError(t('admin.accounts.failedToToggleSchedulable'))
|
appStore.showError(t('admin.accounts.failedToToggleSchedulable'))
|
||||||
|
|||||||
Reference in New Issue
Block a user