Replace Date.getTime() with Date.now()
Change-Id: I7d458880d9f11346a2e2805d9f702f80d1cbf543
diff --git a/client/src/contexts/CallProvider.tsx b/client/src/contexts/CallProvider.tsx
index 000a91d..ce57691 100644
--- a/client/src/contexts/CallProvider.tsx
+++ b/client/src/contexts/CallProvider.tsx
@@ -51,7 +51,7 @@
setIsFullscreen: SetState<boolean>;
callRole: CallRole;
callStatus: CallStatus;
- callStartTime: Date | undefined;
+ callStartTime: number | undefined;
isAnswerButtonDisabled: boolean;
acceptCall: (withVideoOn: boolean) => void;
@@ -105,7 +105,7 @@
const [isFullscreen, setIsFullscreen] = useState(false);
const [callStatus, setCallStatus] = useState(routeState?.callStatus);
const [callRole] = useState(routeState?.role);
- const [callStartTime, setCallStartTime] = useState<Date | undefined>(undefined);
+ const [callStartTime, setCallStartTime] = useState<number | undefined>(undefined);
const [isAnswerButtonDisabled, setIsAnswerButtonDisabled] = useState(false);
// TODO: This logic will have to change to support multiple people in a call. Could we move this logic to the server?
@@ -248,7 +248,7 @@
) {
console.info('Changing call status to InCall');
setCallStatus(CallStatus.InCall);
- setCallStartTime(new Date());
+ setCallStartTime(Date.now());
}
}, [iceConnectionState, callStatus]);