feat: enhance error handling in dashboard layout and improve UI consistency across notification templates with updated styling and structure
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user