fix type errors

This commit is contained in:
m5r 2021-09-25 07:12:16 +08:00
parent c9b657e44c
commit 9dea1ed499
3 changed files with 6 additions and 2 deletions

View File

@ -8,7 +8,7 @@ export default function useConversation(recipient: string) {
{},
{
select(conversations) {
if (!conversations[recipient]) {
if (!conversations?.[recipient]) {
return null;
}

View File

@ -7,6 +7,10 @@ export default function useKnownRecipients() {
{},
{
select(conversations) {
if (!conversations) {
return [];
}
return Object.keys(conversations);
},
},

View File

@ -83,7 +83,7 @@ const KeypadPage: BlitzPage = () => {
<button
onClick={async () => {
if (phoneNumber === "") {
const lastCall = phoneCalls[0];
const lastCall = phoneCalls?.[0];
if (lastCall) {
const lastCallRecipient =
lastCall.direction === Direction.Inbound ? lastCall.from : lastCall.to;