From b0e026c9637e5e405a191337b5dfb094726714e4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 6 Jun 2026 18:06:32 +0000 Subject: [PATCH] Fix ESLint errors: remove setState-in-effect, use nullish coalescing --- src/app/dashboard/time-clock/page.tsx | 2 -- src/server/api/routers/time-entries.ts | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/dashboard/time-clock/page.tsx b/src/app/dashboard/time-clock/page.tsx index b09c99f..1a07cb6 100644 --- a/src/app/dashboard/time-clock/page.tsx +++ b/src/app/dashboard/time-clock/page.tsx @@ -92,8 +92,6 @@ export default function TimeClockPage() { }; tick(); intervalRef.current = setInterval(tick, 1000); - } else { - setElapsed(0); } return () => { if (intervalRef.current) clearInterval(intervalRef.current); diff --git a/src/server/api/routers/time-entries.ts b/src/server/api/routers/time-entries.ts index fc19028..5d7b8fc 100644 --- a/src/server/api/routers/time-entries.ts +++ b/src/server/api/routers/time-entries.ts @@ -91,7 +91,7 @@ export const timeEntriesRouter = createTRPCRouter({ }); } - const clientId = input.clientId?.trim() || null; + const clientId = input.clientId?.trim() ?? null; if (clientId) { const client = await ctx.db.query.clients.findFirst({ where: and(eq(clients.id, clientId), eq(clients.createdById, ctx.session.user.id)), @@ -151,7 +151,7 @@ export const timeEntriesRouter = createTRPCRouter({ create: protectedProcedure .input(createSchema) .mutation(async ({ ctx, input }) => { - const clientId = input.clientId?.trim() || null; + const clientId = input.clientId?.trim() ?? null; if (clientId) { const client = await ctx.db.query.clients.findFirst({ where: and(eq(clients.id, clientId), eq(clients.createdById, ctx.session.user.id)), @@ -173,7 +173,7 @@ export const timeEntriesRouter = createTRPCRouter({ endedAt: input.endedAt ?? null, hours, rate: input.rate ?? null, - notes: input.notes?.trim() || null, + notes: input.notes?.trim() ?? null, createdById: ctx.session.user.id, }) .returning(); @@ -209,7 +209,7 @@ export const timeEntriesRouter = createTRPCRouter({ .set({ ...data, clientId, - notes: data.notes?.trim() || null, + notes: data.notes?.trim() ?? null, updatedAt: new Date(), }) .where(eq(timeEntries.id, id));