Files
sendou.ink/app/features/layout/core/layout.server.ts
2026-09-02 21:02:01 +03:00

16 lines
622 B
TypeScript

import type { AuthenticatedUser } from "~/features/auth/core/user.server";
import { resolveSidebarData } from "~/features/sidebar/core/sidebar.server";
import { GIT_COMMIT } from "~/utils/git-commit";
/**
* App shell data that goes stale while a page sits open; shared by the root loader and the route
* `LayoutDataProvider` polls so they can't drift. Notifications have their own route (`NotificationsProvider`).
*/
export async function resolveLayoutData(user: AuthenticatedUser | undefined) {
return {
loggedInUserId: user?.id ?? null,
sidebar: await resolveSidebarData(user),
buildCommit: GIT_COMMIT,
};
}