From b6fc3f366c525aa1ea7e2e1eabd3e27fb5e535b2 Mon Sep 17 00:00:00 2001 From: cimigree Date: Thu, 21 Nov 2024 13:26:39 -0500 Subject: [PATCH] Fixes crash when permission is taken away. (#851) --- src/frontend/hooks/useFormattedTimeSince.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/hooks/useFormattedTimeSince.ts b/src/frontend/hooks/useFormattedTimeSince.ts index 363baf2ff..8c394dc07 100644 --- a/src/frontend/hooks/useFormattedTimeSince.ts +++ b/src/frontend/hooks/useFormattedTimeSince.ts @@ -3,7 +3,7 @@ import {Duration} from 'luxon'; export const useFormattedTimeSince = (start: Date | null, interval: number) => { const [currentTime, setCurrentTime] = useState(new Date()); - let startDate = start ? start : new Date(); + let startDate = start ? new Date(start) : new Date(); useEffect(() => { setCurrentTime(new Date());