Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend/modules/appconfig/usecase/branding.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ func (s *brandingService) isWhiteLabelEntitled(_ context.Context) bool {
}

// read loads the stored branding (JSON in the `branding` config row), falling
// back to defaults when unset or unparseable.
// back to defaults when unset or unparseable. Uses GetOwn so a tenant without
// its own row gets defaults instead of inheriting the master tenant's brand.
func (s *brandingService) read(ctx context.Context) (dto.BrandingResponse, error) {
resp := dto.BrandingResponse{ProductName: defaultProductName}
row, err := s.repo.GetByKey(ctx, brandingConfigKey)
row, err := s.repo.GetOwn(ctx, brandingConfigKey)
if err != nil {
return resp, err
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/features/auth/services/auth.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ export function AuthProvider({ children }: { children: ReactNode }) {
// Wire the api-client logout fallback (fired when refresh fails).
useEffect(() => {
setLogoutHandler(() => {
setUser(null)
reset()
})
}, [])
}, [reset])

// Apply the user's saved language preference once known (lang_key → i18n).
useEffect(() => {
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/features/branding/services/branding.context.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from 'react'
import { brandingHttpService } from './branding-http.service'
import { getSupportTenantId } from '@/shared/lib/current-tenant'
import { getSupportTenantId, useSupportTenant } from '@/shared/lib/current-tenant'
import type { BrandingPublic } from '../types/branding.types'

interface BrandingContextValue {
Expand Down Expand Up @@ -43,6 +43,7 @@ function applyBranding(b: BrandingPublic | null) {

export function BrandingProvider({ children }: { children: ReactNode }) {
const [branding, setBranding] = useState<BrandingPublic | null>(null)
const supportTenantId = useSupportTenant()?.id ?? null

const refresh = useCallback(async () => {
try {
Expand All @@ -66,7 +67,7 @@ export function BrandingProvider({ children }: { children: ReactNode }) {

useEffect(() => {
void refresh()
}, [refresh])
}, [refresh, supportTenantId])

const value = useMemo(() => ({ branding, refresh }), [branding, refresh])
return <BrandingContext.Provider value={value}>{children}</BrandingContext.Provider>
Expand Down
Loading