mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-14 01:20:03 +00:00
expose user loggedin in extensionManager (#3871)
This commit is contained in:
@@ -6,7 +6,9 @@ import { useColorPaletteService } from '@/services/colorPaletteService'
|
||||
import { useDialogService } from '@/services/dialogService'
|
||||
import type { SidebarTabExtension, ToastManager } from '@/types/extensionTypes'
|
||||
|
||||
import { useApiKeyAuthStore } from './apiKeyAuthStore'
|
||||
import { useCommandStore } from './commandStore'
|
||||
import { useFirebaseAuthStore } from './firebaseAuthStore'
|
||||
import { useQueueSettingsStore } from './queueStore'
|
||||
import { useSettingStore } from './settingStore'
|
||||
import { useToastStore } from './toastStore'
|
||||
@@ -43,6 +45,18 @@ export const useWorkspaceStore = defineStore('workspace', () => {
|
||||
const dialog = useDialogService()
|
||||
const bottomPanel = useBottomPanelStore()
|
||||
|
||||
const authStore = useFirebaseAuthStore()
|
||||
const apiKeyStore = useApiKeyAuthStore()
|
||||
|
||||
const firebaseUser = computed(() => authStore.currentUser)
|
||||
const isApiKeyLogin = computed(() => apiKeyStore.isAuthenticated)
|
||||
const isLoggedIn = computed(
|
||||
() => !!isApiKeyLogin.value || firebaseUser.value !== null
|
||||
)
|
||||
const partialUserStore = {
|
||||
isLoggedIn
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a sidebar tab.
|
||||
* @param tab The sidebar tab to register.
|
||||
@@ -86,6 +100,7 @@ export const useWorkspaceStore = defineStore('workspace', () => {
|
||||
colorPalette,
|
||||
dialog,
|
||||
bottomPanel,
|
||||
user: partialUserStore,
|
||||
|
||||
registerSidebarTab,
|
||||
unregisterSidebarTab,
|
||||
|
||||
Reference in New Issue
Block a user