fix: ๐Ÿ› correct hop public key

This commit is contained in:
AP 2020-06-12 18:07:58 +02:00
parent 96f953ff86
commit 64e8f96da4
5 changed files with 6 additions and 4 deletions

View file

@ -68,7 +68,7 @@ export const getWithCopy = (text: string) => {
};
export const getNodeLink = (publicKey: string, alias?: string) => {
if (alias && alias === 'Node not found') {
if (!publicKey || (alias && alias === 'Node not found')) {
return 'Node not found';
}
const link = `${appUrls.oneml}${publicKey}`;

View file

@ -72,7 +72,7 @@ export type GetResumeQuery = { __typename?: 'Query' } & {
node?: Types.Maybe<
{ __typename?: 'nodeType' } & Pick<
Types.NodeType,
'alias'
'alias' | 'public_key'
>
>;
}
@ -126,6 +126,7 @@ export const GetResumeDocument = gql`
hops {
node {
alias
public_key
}
}
id

View file

@ -39,6 +39,7 @@ export const GET_RESUME = gql`
hops {
node {
alias
public_key
}
}
id

View file

@ -89,7 +89,7 @@ export const Decoded = ({ request, setShow }: DecodedProps) => {
{renderLine('Forwarded Tokens', hop.forward)}
{renderLine(
`Destination `,
getNodeLink(destination, hop.node.node.alias)
getNodeLink(hop.public_key, hop.node.node.alias)
)}
{renderLine('Channel', hop.channel)}
{renderLine(

View file

@ -82,7 +82,7 @@ export const PaymentsCard = ({
{hops.map((hop, index: number) =>
renderLine(
`Hop ${index + 1}:`,
getNodeLink(destination, hop.node.alias)
getNodeLink(hop.node.public_key, hop.node.alias)
)
)}
{renderLine('Id:', id)}