[API Node] Fix credits fetch condition (#3575)

This commit is contained in:
Christian Byrne
2025-04-23 09:33:44 +08:00
committed by GitHub
parent a01aa39423
commit e9723407d8
3 changed files with 60 additions and 39 deletions

View File

@@ -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()
}
})
</script>