Fix ESLint errors: remove setState-in-effect, use nullish coalescing

This commit is contained in:
Claude
2026-06-06 18:06:32 +00:00
parent bdc25e0c58
commit b0e026c963
2 changed files with 4 additions and 6 deletions
-2
View File
@@ -92,8 +92,6 @@ export default function TimeClockPage() {
}; };
tick(); tick();
intervalRef.current = setInterval(tick, 1000); intervalRef.current = setInterval(tick, 1000);
} else {
setElapsed(0);
} }
return () => { return () => {
if (intervalRef.current) clearInterval(intervalRef.current); if (intervalRef.current) clearInterval(intervalRef.current);
+4 -4
View File
@@ -91,7 +91,7 @@ export const timeEntriesRouter = createTRPCRouter({
}); });
} }
const clientId = input.clientId?.trim() || null; const clientId = input.clientId?.trim() ?? null;
if (clientId) { if (clientId) {
const client = await ctx.db.query.clients.findFirst({ const client = await ctx.db.query.clients.findFirst({
where: and(eq(clients.id, clientId), eq(clients.createdById, ctx.session.user.id)), where: and(eq(clients.id, clientId), eq(clients.createdById, ctx.session.user.id)),
@@ -151,7 +151,7 @@ export const timeEntriesRouter = createTRPCRouter({
create: protectedProcedure create: protectedProcedure
.input(createSchema) .input(createSchema)
.mutation(async ({ ctx, input }) => { .mutation(async ({ ctx, input }) => {
const clientId = input.clientId?.trim() || null; const clientId = input.clientId?.trim() ?? null;
if (clientId) { if (clientId) {
const client = await ctx.db.query.clients.findFirst({ const client = await ctx.db.query.clients.findFirst({
where: and(eq(clients.id, clientId), eq(clients.createdById, ctx.session.user.id)), 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, endedAt: input.endedAt ?? null,
hours, hours,
rate: input.rate ?? null, rate: input.rate ?? null,
notes: input.notes?.trim() || null, notes: input.notes?.trim() ?? null,
createdById: ctx.session.user.id, createdById: ctx.session.user.id,
}) })
.returning(); .returning();
@@ -209,7 +209,7 @@ export const timeEntriesRouter = createTRPCRouter({
.set({ .set({
...data, ...data,
clientId, clientId,
notes: data.notes?.trim() || null, notes: data.notes?.trim() ?? null,
updatedAt: new Date(), updatedAt: new Date(),
}) })
.where(eq(timeEntries.id, id)); .where(eq(timeEntries.id, id));