From 5cb16b043eec3f32eb7f5897c2430eea065e9eaf Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Tue, 5 Mar 2024 19:51:50 +0000 Subject: [PATCH] build: Fix the web build --- packages/browser-extension/src/OptionsPage.tsx | 2 +- packages/db/drizzle.config.ts | 4 ---- packages/trpc/index.ts | 4 ++-- packages/trpc/routers/users.ts | 4 ++-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/browser-extension/src/OptionsPage.tsx b/packages/browser-extension/src/OptionsPage.tsx index 913b69ab..6407b3cc 100644 --- a/packages/browser-extension/src/OptionsPage.tsx +++ b/packages/browser-extension/src/OptionsPage.tsx @@ -32,7 +32,7 @@ export default function OptionsPage() { ); } } else if (whoami) { - loggedInMessage = {whoami.name}; + loggedInMessage = {whoami.email}; } else { loggedInMessage = ; } diff --git a/packages/db/drizzle.config.ts b/packages/db/drizzle.config.ts index e2e00af9..4c32e7cc 100644 --- a/packages/db/drizzle.config.ts +++ b/packages/db/drizzle.config.ts @@ -1,10 +1,6 @@ import "dotenv/config"; import type { Config } from "drizzle-kit"; -if (!process.env.DATA_DIR) { - throw new Error("DATA_DIR environment variable is required"); -} - const databaseURL = `${process.env.DATA_DIR}/db.db`; export default { diff --git a/packages/trpc/index.ts b/packages/trpc/index.ts index 6ca0bbf7..bcfa7211 100644 --- a/packages/trpc/index.ts +++ b/packages/trpc/index.ts @@ -5,8 +5,8 @@ import superjson from "superjson"; type User = { id: string; - name: string; - email: string; + name?: string | null | undefined; + email?: string | null | undefined; role: "admin" | "user" | null; }; diff --git a/packages/trpc/routers/users.ts b/packages/trpc/routers/users.ts index efef61af..1a851b05 100644 --- a/packages/trpc/routers/users.ts +++ b/packages/trpc/routers/users.ts @@ -99,8 +99,8 @@ export const usersAppRouter = router({ .output( z.object({ id: z.string(), - name: z.string(), - email: z.string(), + name: z.string().nullish(), + email: z.string().nullish(), }), ) .query(async ({ ctx }) => {