From 423a9cea00185febecedb142b6025121b95b6f96 Mon Sep 17 00:00:00 2001 From: m5r Date: Sun, 8 Aug 2021 19:46:04 +0800 Subject: [PATCH] reset keypad page phoneNumber state when calling --- app/phone-calls/pages/keypad.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/phone-calls/pages/keypad.tsx b/app/phone-calls/pages/keypad.tsx index b0af68d..953b670 100644 --- a/app/phone-calls/pages/keypad.tsx +++ b/app/phone-calls/pages/keypad.tsx @@ -11,7 +11,7 @@ import useRequireOnboarding from "../../core/hooks/use-require-onboarding"; const KeypadPage: BlitzPage = () => { useRequireOnboarding(); - const phoneNumber = useAtom(phoneNumberAtom)[0]; + const [phoneNumber, setPhoneNumber] = useAtom(phoneNumberAtom); const pressBackspace = useAtom(pressBackspaceAtom)[1]; const timeoutRef = useRef | null>(null); const pressDigit = useAtom(pressDigitAtom)[1]; @@ -43,7 +43,10 @@ const KeypadPage: BlitzPage = () => { - + setPhoneNumber("")} + className="cursor-pointer select-none col-start-2 h-12 w-12 flex justify-center items-center mx-auto bg-green-800 rounded-full" + >