From cff70bc23cebc3c0457e5de3a25a2c73bbd43602 Mon Sep 17 00:00:00 2001 From: tiny-craft <137850705+tiny-craft@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:27:18 +0800 Subject: [PATCH] fix: loading status not reset when clean failed --- .../src/components/content/ContentLogPane.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/content/ContentLogPane.vue b/frontend/src/components/content/ContentLogPane.vue index a1e4f90..15dcf93 100644 --- a/frontend/src/components/content/ContentLogPane.vue +++ b/frontend/src/components/content/ContentLogPane.vue @@ -47,14 +47,18 @@ const loadHistory = () => { const cleanHistory = async () => { $dialog.warning(i18n.t('confirm_clean_log'), () => { data.loading = true - connectionStore.cleanCmdHistory().then((success) => { - if (success) { - data.history = [] + connectionStore + .cleanCmdHistory() + .then((success) => { + if (success) { + data.history = [] + tableRef.value?.scrollTo({ top: 0 }) + $message.success(i18n.t('success')) + } + }) + .finally(() => { data.loading = false - tableRef.value?.scrollTo({ top: 0 }) - $message.success(i18n.t('success')) - } - }) + }) }) }