Skip to content

Commit

Permalink
fix: 🐛 type bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
apotdevin committed Jun 7, 2020
1 parent a88eb06 commit 287762c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/views/channels/channels/Channels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ export const Channels: React.FC = () => {
} = channel;

const { capacity, channel_count } = partner_node_info?.node || {};
const {
base_fee_mtokens,
fee_rate,
} = partner_fee_info?.channel?.policies?.[0];
const { base_fee_mtokens, fee_rate } =
partner_fee_info?.channel?.policies?.[0] || {};

const partner = Number(capacity) || 0;
const channels = Number(channel_count) || 0;
Expand Down
5 changes: 3 additions & 2 deletions src/views/chat/ChatStart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import { X, ChevronRight } from 'react-feather';
import { useAccountState } from 'src/context/AccountContext';
import { useGetPeersQuery } from 'src/graphql/queries/__generated__/getPeers.generated';
import { PeerType } from 'src/graphql/types';
import { Input } from '../../components/input/Input';
import {
SubCard,
Expand All @@ -20,7 +21,7 @@ import {
} from './Chat.styled';

interface PeerProps {
peer: any;
peer: PeerType;
index: number;
setIndexOpen: (index: number) => void;
indexOpen: number;
Expand All @@ -29,7 +30,7 @@ interface PeerProps {
const PeerChatCard = ({ peer, index, setIndexOpen, indexOpen }: PeerProps) => {
const { partner_node_info, public_key } = peer;

const { alias } = partner_node_info;
const alias = partner_node_info?.node?.alias;

const handleClick = () => {
if (indexOpen === index) {
Expand Down
2 changes: 1 addition & 1 deletion src/views/chat/Contacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const ContactCard = ({

React.useEffect(() => {
if (!loading && data && data.getNode) {
const { alias } = data.getNode;
const alias = data.getNode?.node?.alias;
const name =
alias && alias !== '' ? alias : contactSender.substring(0, 6);
setNodeName(name);
Expand Down
2 changes: 1 addition & 1 deletion src/views/home/account/AccountInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { mediaWidths } from '../../../styles/Themes';
import { useStatusState } from '../../../context/StatusContext';
import { ReceiveOnChainCard } from './receiveOnChain/ReceiveOnChain';
import { SendOnChainCard } from './sendOnChain/SendOnChain';
import { PayCard } from './pay/Pay';
import { PayCard } from './pay/Payment';
import { CreateInvoiceCard } from './createInvoice/CreateInvoice';

const Tile = styled.div`
Expand Down
File renamed without changes.

0 comments on commit 287762c

Please sign in to comment.