fix: loading status not reset when clean failed

This commit is contained in:
tiny-craft 2023-08-29 10:27:18 +08:00
parent c01be7fcca
commit cff70bc23c
1 changed files with 11 additions and 7 deletions

View File

@ -47,14 +47,18 @@ const loadHistory = () => {
const cleanHistory = async () => { const cleanHistory = async () => {
$dialog.warning(i18n.t('confirm_clean_log'), () => { $dialog.warning(i18n.t('confirm_clean_log'), () => {
data.loading = true data.loading = true
connectionStore.cleanCmdHistory().then((success) => { connectionStore
.cleanCmdHistory()
.then((success) => {
if (success) { if (success) {
data.history = [] data.history = []
data.loading = false
tableRef.value?.scrollTo({ top: 0 }) tableRef.value?.scrollTo({ top: 0 })
$message.success(i18n.t('success')) $message.success(i18n.t('success'))
} }
}) })
.finally(() => {
data.loading = false
})
}) })
} }