fix(frontend): resolve set-state-in-effect lint errors

This commit is contained in:
Michael Chihlas
2026-02-11 19:09:29 -05:00
parent ca4ce7cad6
commit 06c66f5595
2 changed files with 15 additions and 21 deletions

View File

@@ -11,10 +11,7 @@ export function useSessionTimer(startedAt: string | undefined | null): string |
intervalRef.current = null
}
if (!startedAt) {
setElapsed(null)
return
}
if (!startedAt) return
const parsedStartTime = new Date(startedAt).getTime()
// If the server timestamp is invalid or ahead of the local clock, fall back to "now"
@@ -40,5 +37,5 @@ export function useSessionTimer(startedAt: string | undefined | null): string |
}
}, [startedAt])
return elapsed
return startedAt ? elapsed : null
}