feat: enhance error handling in dashboard layout and improve UI consistency across notification templates with updated styling and structure

This commit is contained in:
2025-12-01 11:45:27 -03:00
parent 4af566e54c
commit a149c5ead6
8 changed files with 3100 additions and 2450 deletions

View File

@@ -2,8 +2,13 @@ import { api } from "@sgse-app/backend/convex/_generated/api";
import { createConvexHttpClient } from "@mmailaender/convex-better-auth-svelte/sveltekit";
export const load = async ({ locals }) => {
const client = createConvexHttpClient({ token: locals.token });
const currentUser = await client.query(api.auth.getCurrentUser, {});
return { currentUser };
try {
const client = createConvexHttpClient({ token: locals.token });
const currentUser = await client.query(api.auth.getCurrentUser, {});
return { currentUser };
} catch (error) {
console.error("Erro ao carregar usuário atual no layout do dashboard:", error);
// Evita quebrar toda a área logada em caso de falha transitória na API/auth
return { currentUser: null };
}
};