From aceece8a41b17c14cc9767041ab714f899ce6175 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 | 8 +++----- packages/trpc/index.ts | 4 ++-- packages/trpc/routers/users.ts | 4 ++-- 4 files changed, 8 insertions(+), 10 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..16aa286f 100644 --- a/packages/db/drizzle.config.ts +++ b/packages/db/drizzle.config.ts @@ -1,11 +1,9 @@ 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`; +const databaseURL = process.env.DATA_DIR + ? `${process.env.DATA_DIR}/db.db` + : "./db.db"; export default { schema: "./schema.ts", 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 }) => {