Avoid tenant loading flash when me session is already cached.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Mortezakoohjani 2026-07-26 18:31:47 +03:30
parent 86b37c1de9
commit cdb69b014b

View File

@ -2,12 +2,12 @@
import { useMe } from "@/hooks/useMe"; import { useMe } from "@/hooks/useMe";
/** Tenant ID جاری برای هدر X-Tenant-ID سرویس حسابداری. */ /** Tenant ID جاری برای هدر X-Tenant-ID سرویس حسابداری (از کش مشترک useMe). */
export function useTenantId() { export function useTenantId() {
const { me, loading, error } = useMe(); const { me, loading, error } = useMe();
return { return {
tenantId: me?.current_tenant_id ?? null, tenantId: me?.current_tenant_id ?? null,
loading, loading: loading && !me,
error, error,
me, me,
}; };