diff --git a/src/components/dialog/content/SettingDialogContent.vue b/src/components/dialog/content/SettingDialogContent.vue index 4fa3b3908..abac9a7c0 100644 --- a/src/components/dialog/content/SettingDialogContent.vue +++ b/src/components/dialog/content/SettingDialogContent.vue @@ -86,6 +86,7 @@ import { computed, defineAsyncComponent, watch } from 'vue' import SearchBox from '@/components/common/SearchBox.vue' import { useSettingSearch } from '@/composables/setting/useSettingSearch' import { useSettingUI } from '@/composables/setting/useSettingUI' +import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore' import { SettingTreeNode } from '@/stores/settingStore' import { ISettingGroup, SettingParams } from '@/types/settingTypes' import { flattenTree } from '@/utils/treeUtil' @@ -135,6 +136,8 @@ const { getSearchResults } = useSettingSearch() +const authStore = useFirebaseAuthStore() + // Sort groups for a category const sortedGroups = (category: SettingTreeNode): ISettingGroup[] => { return [...(category.children ?? [])] @@ -165,6 +168,9 @@ watch(activeCategory, (_, oldValue) => { if (!tabValue.value) { activeCategory.value = oldValue } + if (activeCategory.value?.key === 'credits') { + void authStore.fetchBalance() + } }) diff --git a/src/components/dialog/content/setting/CreditsPanel.vue b/src/components/dialog/content/setting/CreditsPanel.vue index fdc1551f0..70e3c67d8 100644 --- a/src/components/dialog/content/setting/CreditsPanel.vue +++ b/src/components/dialog/content/setting/CreditsPanel.vue @@ -12,7 +12,14 @@ {{ $t('credits.yourCreditBalance') }}
-
+
+
+ +
+
+ +
+
{{ formattedBalance }}
- +
-
+ +
{{ $t('credits.lastUpdated') }}: {{ formattedLastUpdateTime }}