fix(frontend): resolve set-state-in-effect lint errors
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user