mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-18 09:14:04 -05:00
16 lines
622 B
TypeScript
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,
|
|
};
|
|
}
|