mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-05 05:00:03 +00:00
refactor: use feature flags but override true
This commit is contained in:
@@ -95,10 +95,11 @@ export function useFeatureFlags() {
|
||||
)
|
||||
},
|
||||
get teamWorkspacesEnabled() {
|
||||
return (
|
||||
remoteConfig.value.team_workspaces_enabled ??
|
||||
api.getServerFeature(ServerFeatureFlag.TEAM_WORKSPACES_ENABLED, false)
|
||||
)
|
||||
return true
|
||||
// return (
|
||||
// remoteConfig.value.team_workspaces_enabled ??
|
||||
// api.getServerFeature(ServerFeatureFlag.TEAM_WORKSPACES_ENABLED, false)
|
||||
// )
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useFeatureFlags } from '@/composables/useFeatureFlags'
|
||||
import { isCloud } from '@/platform/distribution/types'
|
||||
import { api } from '@/scripts/api'
|
||||
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
|
||||
@@ -18,15 +19,13 @@ export const useSessionCookie = () => {
|
||||
const createSession = async (): Promise<void> => {
|
||||
if (!isCloud) return
|
||||
|
||||
const { flags } = useFeatureFlags()
|
||||
try {
|
||||
const authStore = useFirebaseAuthStore()
|
||||
|
||||
let authHeader: Record<string, string>
|
||||
|
||||
// TODO: Use remoteConfig.value.team_workspaces_enabled when backend enables the flag
|
||||
// Currently hardcoded to match router.ts behavior
|
||||
const teamWorkspacesEnabled = true
|
||||
if (teamWorkspacesEnabled) {
|
||||
if (flags.teamWorkspacesEnabled) {
|
||||
const firebaseToken = await authStore.getIdToken()
|
||||
if (!firebaseToken) {
|
||||
console.warn(
|
||||
|
||||
@@ -184,9 +184,8 @@ if (isCloud) {
|
||||
|
||||
// Initialize workspace context for logged-in users navigating to root
|
||||
// This must happen before the app loads to ensure workspace context is ready
|
||||
// TODO: Use flags.teamWorkspacesEnabled when backend enables the flag
|
||||
const teamWorkspacesEnabled = true
|
||||
if (to.path === '/' && teamWorkspacesEnabled) {
|
||||
|
||||
if (to.path === '/' && flags.teamWorkspacesEnabled) {
|
||||
const { useTeamWorkspaceStore } =
|
||||
await import('@/platform/workspace/stores/teamWorkspaceStore')
|
||||
const workspaceStore = useTeamWorkspaceStore()
|
||||
|
||||
@@ -30,6 +30,7 @@ import { useDialogService } from '@/services/dialogService'
|
||||
import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore'
|
||||
import type { AuthHeader } from '@/types/authTypes'
|
||||
import type { operations } from '@/types/comfyRegistryTypes'
|
||||
import { useFeatureFlags } from '@/composables/useFeatureFlags'
|
||||
|
||||
type CreditPurchaseResponse =
|
||||
operations['InitiateCreditPurchase']['responses']['201']['content']['application/json']
|
||||
@@ -57,6 +58,8 @@ export class FirebaseAuthStoreError extends Error {
|
||||
}
|
||||
|
||||
export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
|
||||
const { flags } = useFeatureFlags()
|
||||
|
||||
// State
|
||||
const loading = ref(false)
|
||||
const currentUser = ref<User | null>(null)
|
||||
@@ -172,10 +175,7 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
|
||||
* - null if no authentication method is available
|
||||
*/
|
||||
const getAuthHeader = async (): Promise<AuthHeader | null> => {
|
||||
// TODO: Use remoteConfig.value.team_workspaces_enabled when backend enables the flag
|
||||
// Currently hardcoded to match router.ts behavior
|
||||
const teamWorkspacesEnabled = true
|
||||
if (teamWorkspacesEnabled) {
|
||||
if (flags.teamWorkspacesEnabled) {
|
||||
const workspaceToken = sessionStorage.getItem(
|
||||
WORKSPACE_STORAGE_KEYS.TOKEN
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user