[API Node] Show user state when logged in via API key (#3838)

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chenlei Hu <hcl@comfy.org>
This commit is contained in:
Christian Byrne
2025-05-09 11:45:32 -07:00
committed by GitHub
parent fdad2475ce
commit 6408623b71
14 changed files with 192 additions and 101 deletions

View File

@@ -7,13 +7,14 @@ import {
} from 'vue'
import { useI18n } from 'vue-i18n'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
import { SettingTreeNode, useSettingStore } from '@/stores/settingStore'
import type { SettingParams } from '@/types/settingTypes'
import { isElectron } from '@/utils/envUtil'
import { normalizeI18nKey } from '@/utils/formatUtil'
import { buildTree } from '@/utils/treeUtil'
import { useCurrentUser } from '../auth/useCurrentUser'
interface SettingPanelItem {
node: SettingTreeNode
component: Component
@@ -29,7 +30,7 @@ export function useSettingUI(
| 'credits'
) {
const { t } = useI18n()
const firebaseAuthStore = useFirebaseAuthStore()
const { isLoggedIn } = useCurrentUser()
const settingStore = useSettingStore()
const activeCategory = ref<SettingTreeNode | null>(null)
@@ -165,7 +166,7 @@ export function useSettingUI(
label: 'Account',
children: [
userPanel.node,
...(firebaseAuthStore.isAuthenticated ? [creditsPanel.node] : [])
...(isLoggedIn.value ? [creditsPanel.node] : [])
].map(translateCategory)
},
// Normal settings stored in the settingStore