diff --git a/app/phone-calls/hooks/use-make-call.ts b/app/phone-calls/hooks/use-make-call.ts index a90d330..99ec76b 100644 --- a/app/phone-calls/hooks/use-make-call.ts +++ b/app/phone-calls/hooks/use-make-call.ts @@ -87,7 +87,7 @@ export default function useMakeCall(recipient: string) { if (device) { device.disconnectAll(); - // device.destroy(); + device.destroy(); } } diff --git a/app/phone-calls/pages/keypad.tsx b/app/phone-calls/pages/keypad.tsx index 953b670..61ac022 100644 --- a/app/phone-calls/pages/keypad.tsx +++ b/app/phone-calls/pages/keypad.tsx @@ -1,5 +1,5 @@ import type { BlitzPage } from "blitz"; -import { Link, Routes } from "blitz"; +import { Link, Routes, useRouter } from "blitz"; import { useRef } from "react"; import { atom, useAtom } from "jotai"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; @@ -11,6 +11,7 @@ import useRequireOnboarding from "../../core/hooks/use-require-onboarding"; const KeypadPage: BlitzPage = () => { useRequireOnboarding(); + const router = useRouter(); const [phoneNumber, setPhoneNumber] = useAtom(phoneNumberAtom); const pressBackspace = useAtom(pressBackspaceAtom)[1]; const timeoutRef = useRef | null>(null); @@ -31,6 +32,7 @@ const KeypadPage: BlitzPage = () => { }; const onDigitPressProps = (digit: string) => ({ onPress() { + // navigator.vibrate(1); // removed in webkit pressDigit(digit); }, }); @@ -43,12 +45,19 @@ const KeypadPage: BlitzPage = () => { - setPhoneNumber("")} +
diff --git a/app/phone-calls/pages/outgoing-call/[recipient].tsx b/app/phone-calls/pages/outgoing-call/[recipient].tsx index 157c5c7..46bb20d 100644 --- a/app/phone-calls/pages/outgoing-call/[recipient].tsx +++ b/app/phone-calls/pages/outgoing-call/[recipient].tsx @@ -22,7 +22,7 @@ const OutgoingCall: BlitzPage = () => { }, [call.state]); useRequireOnboarding(); - const phoneNumber = useAtom(phoneNumberAtom)[0]; + const [phoneNumber, setPhoneNumber] = useAtom(phoneNumberAtom); const pressDigit = useAtom(pressDigitAtom)[1]; const onDigitPressProps = useMemo( () => (digit: string) => ({ @@ -37,11 +37,12 @@ const OutgoingCall: BlitzPage = () => { const hangUp = useMemo( () => () => { call.hangUp(); + setPhoneNumber(""); // return router.replace(Routes.KeypadPage()); return router.push(Routes.KeypadPage()); }, - [call, router], + [call, router, setPhoneNumber], ); return ( @@ -56,12 +57,12 @@ const OutgoingCall: BlitzPage = () => {
-
-
+
);