Avoid tenant loading flash when me session is already cached.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
86b37c1de9
commit
cdb69b014b
@ -2,12 +2,12 @@
|
||||
|
||||
import { useMe } from "@/hooks/useMe";
|
||||
|
||||
/** Tenant ID جاری برای هدر X-Tenant-ID سرویس حسابداری. */
|
||||
/** Tenant ID جاری برای هدر X-Tenant-ID سرویس حسابداری (از کش مشترک useMe). */
|
||||
export function useTenantId() {
|
||||
const { me, loading, error } = useMe();
|
||||
return {
|
||||
tenantId: me?.current_tenant_id ?? null,
|
||||
loading,
|
||||
loading: loading && !me,
|
||||
error,
|
||||
me,
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user