Skip to content

Commit 109b1ed

Browse files
committed
Fixes type error with the dashboardPreferences implementation
1 parent 2303ffe commit 109b1ed

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

apps/webapp/app/components/navigation/SideMenu.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ import { type MatchedProject } from "~/hooks/useProject";
4343
import { useHasAdminAccess } from "~/hooks/useUser";
4444
import { useShortcutKeys } from "~/hooks/useShortcutKeys";
4545
import { ShortcutKey } from "../primitives/ShortcutKey";
46-
import { type User } from "~/models/user.server";
47-
import { type DashboardPreferences } from "~/services/dashboardPreferences.server";
46+
import { type UserWithDashboardPreferences } from "~/models/user.server";
4847
import { useCurrentPlan } from "~/routes/_app.orgs.$organizationSlug/route";
4948
import { type FeedbackType } from "~/routes/resources.feedback";
5049
import { IncidentStatusPanel } from "~/routes/resources.incidents";
@@ -105,9 +104,8 @@ import { SideMenuHeader } from "./SideMenuHeader";
105104
import { SideMenuItem } from "./SideMenuItem";
106105
import { SideMenuSection } from "./SideMenuSection";
107106

108-
type SideMenuUser = Pick<User, "email" | "admin"> & {
107+
type SideMenuUser = Pick<UserWithDashboardPreferences, "email" | "admin" | "dashboardPreferences"> & {
109108
isImpersonating: boolean;
110-
dashboardPreferences: DashboardPreferences;
111109
};
112110
export type SideMenuProject = Pick<
113111
MatchedProject,

apps/webapp/app/hooks/useUser.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { UIMatch } from "@remix-run/react";
2-
import type { User } from "~/models/user.server";
3-
import { loader } from "~/root";
1+
import { type UIMatch } from "@remix-run/react";
2+
import type { UserWithDashboardPreferences } from "~/models/user.server";
3+
import { type loader } from "~/root";
44
import { useChanged } from "./useChanged";
55
import { useTypedMatchesData } from "./useTypedMatchData";
66
import { useIsImpersonating } from "./useOrganizations";
77

8+
export type User = UserWithDashboardPreferences;
9+
810
export function useOptionalUser(matches?: UIMatch[]): User | undefined {
911
const routeMatch = useTypedMatchesData<typeof loader>({
1012
id: "root",

0 commit comments

Comments
 (0)