From 275c9bacd8f05e92ca0e77cb333893ee2f5c773c Mon Sep 17 00:00:00 2001 From: lgmarchi Date: Wed, 13 Nov 2024 18:21:33 -0300 Subject: [PATCH] fix(calling): refactor code to avoid getTime from a null variable --- src/lib/components/calling/CallScreen.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/components/calling/CallScreen.svelte b/src/lib/components/calling/CallScreen.svelte index 56270ba79..5427bb5f2 100644 --- a/src/lib/components/calling/CallScreen.svelte +++ b/src/lib/components/calling/CallScreen.svelte @@ -213,10 +213,11 @@ }, TIME_TO_SHOW_CONNECTING) } } - if ($timeCallStarted) { + let timeCallStarted = $timeCallStarted + if (timeCallStarted !== null) { let timeCallStartedInterval = setInterval(() => { let now = new Date() - let timeDifference = now.getTime() - $timeCallStarted.getTime() + let timeDifference = now.getTime() - timeCallStarted.getTime() if (timeDifference > TIME_TO_SHOW_CONNECTING) { showAnimation = false noResponseVisible = true