fix: rename leftover firebaseAuthStore/firebaseAuthActions local variables

Address review feedback: rename all local variable bindings from
firebaseAuthStore → authStore and firebaseAuthActions → authActions
to match the renamed store/composable exports.

Also add explicit vi import to authStoreMock.ts for robustness.

https://github.com/Comfy-Org/ComfyUI_frontend/pull/10483#discussion_r2990335291
This commit is contained in:
bymyself
2026-03-25 12:02:05 -07:00
parent ed7ceab571
commit 3831868e11
10 changed files with 26 additions and 26 deletions

View File

@@ -95,7 +95,7 @@ import { useAuthStore } from '@/stores/authStore'
import { cn } from '@/utils/tailwindUtil'
const authStore = useAuthStore()
const firebaseAuthActions = useAuthActions()
const authActions = useAuthActions()
const loading = computed(() => authStore.loading)
const toast = useToast()
@@ -127,6 +127,6 @@ const handleForgotPassword = async (
document.getElementById(emailInputId)?.focus?.()
return
}
await firebaseAuthActions.sendPasswordReset(email)
await authActions.sendPasswordReset(email)
}
</script>

View File

@@ -33,7 +33,7 @@ export function useLegacyBilling(): BillingState & BillingActions {
showSubscriptionDialog: legacyShowSubscriptionDialog
} = useSubscription()
const firebaseAuthStore = useAuthStore()
const authStore = useAuthStore()
const isInitialized = ref(false)
const isLoading = ref(false)
@@ -55,12 +55,12 @@ export function useLegacyBilling(): BillingState & BillingActions {
renewalDate: formattedRenewalDate.value || null,
endDate: formattedEndDate.value || null,
isCancelled: isCancelled.value,
hasFunds: (firebaseAuthStore.balance?.amount_micros ?? 0) > 0
hasFunds: (authStore.balance?.amount_micros ?? 0) > 0
}
})
const balance = computed<BalanceInfo | null>(() => {
const legacyBalance = firebaseAuthStore.balance
const legacyBalance = authStore.balance
if (!legacyBalance) return null
return {
@@ -118,7 +118,7 @@ export function useLegacyBilling(): BillingState & BillingActions {
isLoading.value = true
error.value = null
try {
await firebaseAuthStore.fetchBalance()
await authStore.fetchBalance()
} catch (err) {
error.value =
err instanceof Error ? err.message : 'Failed to fetch balance'

View File

@@ -78,7 +78,7 @@ export function useCoreCommands(): ComfyCommand[] {
const settingsDialog = useSettingsDialog()
const dialogService = useDialogService()
const colorPaletteStore = useColorPaletteStore()
const firebaseAuthActions = useAuthActions()
const authActions = useAuthActions()
const toastStore = useToastStore()
const canvasStore = useCanvasStore()
const executionStore = useExecutionStore()
@@ -996,7 +996,7 @@ export function useCoreCommands(): ComfyCommand[] {
label: 'Sign Out',
versionAdded: '1.18.1',
function: async () => {
await firebaseAuthActions.logout()
await authActions.logout()
}
},
{

View File

@@ -37,8 +37,8 @@ function useSubscriptionInternal() {
const { reportError, accessBillingPortal } = useAuthActions()
const { showSubscriptionRequiredDialog } = useDialogService()
const firebaseAuthStore = useAuthStore()
const { getAuthHeader } = firebaseAuthStore
const authStore = useAuthStore()
const { getAuthHeader } = authStore
const { wrapWithErrorHandlingAsync } = useErrorHandling()
const { isLoggedIn } = useCurrentUser()

View File

@@ -48,10 +48,10 @@ export async function performSubscriptionCheckout(
): Promise<void> {
if (!isCloud) return
const firebaseAuthStore = useAuthStore()
const { userId } = storeToRefs(firebaseAuthStore)
const authStore = useAuthStore()
const { userId } = storeToRefs(authStore)
const telemetry = useTelemetry()
const authHeader = await firebaseAuthStore.getAuthHeader()
const authHeader = await authStore.getAuthHeader()
if (!authHeader) {
throw new AuthStoreError(t('toastMessages.userNotAuthenticated'))

View File

@@ -17,7 +17,7 @@ export class ImpactTelemetryProvider implements TelemetryProvider {
private initialized = false
private stores: {
apiKeyAuthStore: ReturnType<typeof useApiKeyAuthStore>
firebaseAuthStore: ReturnType<typeof useAuthStore>
authStore: ReturnType<typeof useAuthStore>
} | null = null
constructor() {
@@ -109,12 +109,11 @@ export class ImpactTelemetryProvider implements TelemetryProvider {
}
}
if (stores.firebaseAuthStore.currentUser) {
if (stores.authStore.currentUser) {
return {
customerId:
stores.firebaseAuthStore.currentUser.uid ?? EMPTY_CUSTOMER_VALUE,
customerId: stores.authStore.currentUser.uid ?? EMPTY_CUSTOMER_VALUE,
customerEmail:
stores.firebaseAuthStore.currentUser.email ?? EMPTY_CUSTOMER_VALUE
stores.authStore.currentUser.email ?? EMPTY_CUSTOMER_VALUE
}
}
@@ -135,7 +134,7 @@ export class ImpactTelemetryProvider implements TelemetryProvider {
private resolveAuthStores(): {
apiKeyAuthStore: ReturnType<typeof useApiKeyAuthStore>
firebaseAuthStore: ReturnType<typeof useAuthStore>
authStore: ReturnType<typeof useAuthStore>
} | null {
if (this.stores) {
return this.stores
@@ -144,7 +143,7 @@ export class ImpactTelemetryProvider implements TelemetryProvider {
try {
const stores = {
apiKeyAuthStore: useApiKeyAuthStore(),
firebaseAuthStore: useAuthStore()
authStore: useAuthStore()
}
this.stores = stores
return stores

View File

@@ -181,8 +181,8 @@ export const useWorkspaceAuthStore = defineStore('workspaceAuth', () => {
error.value = null
try {
const firebaseAuthStore = useAuthStore()
const firebaseToken = await firebaseAuthStore.getIdToken()
const authStore = useAuthStore()
const firebaseToken = await authStore.getIdToken()
if (!firebaseToken) {
throw new WorkspaceAuthError(
t('workspaceAuth.errors.notAuthenticated'),

View File

@@ -1,3 +1,4 @@
import { vi } from 'vitest'
import type { Mock } from 'vitest'
import { computed, reactive, ref } from 'vue'

View File

@@ -15,7 +15,7 @@ type ComfyApiUser =
const STORAGE_KEY = 'comfy_api_key'
export const useApiKeyAuthStore = defineStore('apiKeyAuth', () => {
const firebaseAuthStore = useAuthStore()
const authStore = useAuthStore()
const apiKey = useLocalStorage<string | null>(STORAGE_KEY, null)
const toastStore = useToastStore()
const { wrapWithErrorHandlingAsync, toastErrorHandler } = useErrorHandling()
@@ -24,7 +24,7 @@ export const useApiKeyAuthStore = defineStore('apiKeyAuth', () => {
const isAuthenticated = computed(() => !!currentUser.value)
const initializeUserFromApiKey = async () => {
const createCustomerResponse = await firebaseAuthStore
const createCustomerResponse = await authStore
.createCustomer()
.catch((err) => {
console.error(err)

View File

@@ -120,7 +120,7 @@ watch(linearMode, (isLinear) => {
})
const telemetry = useTelemetry()
const firebaseAuthStore = useAuthStore()
const authStore = useAuthStore()
let hasTrackedLogin = false
watch(
@@ -308,7 +308,7 @@ void nextTick(() => {
const onGraphReady = () => {
runWhenGlobalIdle(() => {
// Track user login when app is ready in graph view (cloud only)
if (isCloud && firebaseAuthStore.isAuthenticated && !hasTrackedLogin) {
if (isCloud && authStore.isAuthenticated && !hasTrackedLogin) {
telemetry?.trackUserLoggedIn()
hasTrackedLogin = true
}