diff --git a/src/client/src/views/dashboard/widgets/lightning/forwards.tsx b/src/client/src/views/dashboard/widgets/lightning/forwards.tsx index 43055343..547acfec 100644 --- a/src/client/src/views/dashboard/widgets/lightning/forwards.tsx +++ b/src/client/src/views/dashboard/widgets/lightning/forwards.tsx @@ -74,8 +74,8 @@ export const ForwardListWidget = () => { ), - incoming: f.incoming_channel_info.node2_info.alias || '', - outgoing: f.outgoing_channel_info.node2_info.alias || '', + incoming: f.incoming_channel_info?.node2_info.alias || 'Unknown', + outgoing: f.outgoing_channel_info?.node2_info.alias || 'Unknown', }, ]; }, [] as any); diff --git a/src/client/src/views/forwards/forwardSankey.tsx b/src/client/src/views/forwards/forwardSankey.tsx index 368713a3..a5aec13b 100644 --- a/src/client/src/views/forwards/forwardSankey.tsx +++ b/src/client/src/views/forwards/forwardSankey.tsx @@ -35,7 +35,9 @@ export const ForwardSankey: FC<{ const mapped = data.getForwards.map(d => ({ ...d, group: `${d.incoming_channel}-${d.outgoing_channel}`, - groupAlias: `${d.incoming_channel_info.node2_info.alias}-${d.outgoing_channel_info.node2_info.alias}`, + groupAlias: `${d.incoming_channel_info?.node2_info.alias || 'Unknown'}-${ + d.outgoing_channel_info?.node2_info.alias || 'Unknown' + }`, })); const grouped = groupBy(mapped, 'groupAlias'); @@ -56,8 +58,10 @@ export const ForwardSankey: FC<{ const firstValue = value[0]; aggregated.push({ - incoming_channel: firstValue.incoming_channel_info.node2_info.alias, - outgoing_channel: firstValue.outgoing_channel_info.node2_info.alias, + incoming_channel: + firstValue.incoming_channel_info?.node2_info.alias || 'Unknown', + outgoing_channel: + firstValue.outgoing_channel_info?.node2_info.alias || 'Unknown', fee: totalFees, tokens: totalTokens, amount: totalAmount, diff --git a/src/client/src/views/forwards/helpers.tsx b/src/client/src/views/forwards/helpers.tsx index b7637da1..f148b45b 100644 --- a/src/client/src/views/forwards/helpers.tsx +++ b/src/client/src/views/forwards/helpers.tsx @@ -12,9 +12,9 @@ export const sortByNode = (order: string, forwardArray: Forward[]) => { } return { - incoming_alias: f.incoming_channel_info.node2_info.alias || '', + incoming_alias: f.incoming_channel_info?.node2_info.alias || 'Unknown', incoming_channel: f.incoming_channel, - outgoing_alias: f.outgoing_channel_info.node2_info.alias || '', + outgoing_alias: f.outgoing_channel_info?.node2_info.alias || 'Unknown', outgoing_channel: f.outgoing_channel, value, }; diff --git a/src/client/src/views/forwards/index.tsx b/src/client/src/views/forwards/index.tsx index 98e9547f..e31275ef 100644 --- a/src/client/src/views/forwards/index.tsx +++ b/src/client/src/views/forwards/index.tsx @@ -24,8 +24,8 @@ export const ForwardsList: FC = ({ days }) => { return channelData.map(c => { return { ...c, - incoming_name: c.incoming_channel_info.node2_info.alias || '', - outgoing_name: c.outgoing_channel_info.node2_info.alias || '', + incoming_name: c.incoming_channel_info?.node2_info.alias || 'Unknown', + outgoing_name: c.outgoing_channel_info?.node2_info.alias || 'Unknown', }; }); }, [data]); diff --git a/src/client/src/views/home/reports/forwardReport/helpers.ts b/src/client/src/views/home/reports/forwardReport/helpers.ts index e6c5d3e9..4305aae7 100644 --- a/src/client/src/views/home/reports/forwardReport/helpers.ts +++ b/src/client/src/views/home/reports/forwardReport/helpers.ts @@ -77,8 +77,10 @@ const countRoutes = (list: Forward[]) => { .reduce((p: number, c: number) => p + c); channelInfo.push({ - incoming_alias: element[0].incoming_channel_info.node2_info.alias || '', - outgoing_alias: element[0].outgoing_channel_info.node2_info.alias || '', + incoming_alias: + element[0].incoming_channel_info?.node2_info.alias || 'Unknown', + outgoing_alias: + element[0].outgoing_channel_info?.node2_info.alias || 'Unknown', incoming_channel: element[0].incoming_channel, outgoing_channel: element[0].outgoing_channel, route: key, @@ -114,8 +116,8 @@ const countArray = (list: Forward[], type: boolean) => { : element[0].outgoing_channel; const alias = type - ? element[0].incoming_channel_info.node2_info.alias || '' - : element[0].outgoing_channel_info.node2_info.alias || ''; + ? element[0].incoming_channel_info?.node2_info.alias || 'Unknown' + : element[0].outgoing_channel_info?.node2_info.alias || 'Unknown'; channelInfo.push({ alias,