diff --git a/frontend/src/routes/dashboard/customs_brokers/+page.svelte b/frontend/src/routes/dashboard/customs_brokers/+page.svelte index b926ce5f..a6f35421 100644 --- a/frontend/src/routes/dashboard/customs_brokers/+page.svelte +++ b/frontend/src/routes/dashboard/customs_brokers/+page.svelte @@ -5,7 +5,7 @@ import { Button } from '$lib/components/ui/button'; import { Input } from '$lib/components/ui/input'; import { Label } from '$lib/components/ui/label'; - import { Plus, RefreshCw, Building2, MapPin, Mail, Phone, FileText, Hash } from 'lucide-svelte'; + import { Plus, RefreshCw, Building2, MapPin, Mail, Phone, FileText, Hash, LoaderCircle } from 'lucide-svelte'; import * as Tabs from '$lib/components/ui/tabs'; import { toast } from 'svelte-sonner'; import { companyStore } from '$lib/stores/company.svelte'; @@ -14,7 +14,7 @@ import { page } from '$app/stores'; import { useShortcuts } from '$lib/hooks/use-shortcuts'; import { obtenerAtajosListaAgentes } from '$lib/config/shortcuts/dashboard/customs_brokers/list'; - import { currentUser } from '$lib/auth'; + import { currentUser, permissionsHydrated } from '$lib/auth'; import { canViewCustomsBrokers, canCreateCustomsBrokers, @@ -236,7 +236,14 @@ const brokerColumns = createBrokerColumns(handleActionSuccess); -{#if !canViewBrokerList} +{#if !$permissionsHydrated} +
+ +

Verificando permisos…

+
+{:else if !canViewBrokerList}
diff --git a/frontend/src/routes/dashboard/reference_data/customs_sections/+page.svelte b/frontend/src/routes/dashboard/reference_data/customs_sections/+page.svelte index 4fa5d730..2023dc02 100644 --- a/frontend/src/routes/dashboard/reference_data/customs_sections/+page.svelte +++ b/frontend/src/routes/dashboard/reference_data/customs_sections/+page.svelte @@ -12,10 +12,10 @@ import { Input } from '$lib/components/ui/input'; import { page } from '$app/stores'; import { browser } from '$app/environment'; - import { RefreshCw, Plus } from 'lucide-svelte'; + import { RefreshCw, Plus, LoaderCircle } from 'lucide-svelte'; import { useShortcuts } from '$lib/hooks/use-shortcuts'; import type { PageData } from './$types'; - import { currentUser } from '$lib/auth'; + import { currentUser, permissionsHydrated } from '$lib/auth'; import { userHasCustomsSectionsRefAction } from '$lib/permissions/reference-data/customs-sections-ref-permissions'; import ErrorState from '$lib/components/dashboard/common/error-state.svelte'; @@ -124,7 +124,12 @@
- {#if !canView || isError} + {#if !$permissionsHydrated} +
+ +

Verificando permisos…

+
+ {:else if !canView || isError}