diff options
Diffstat (limited to 'gui/src/renderer/components')
| -rw-r--r-- | gui/src/renderer/components/ConnectionPanel.tsx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gui/src/renderer/components/ConnectionPanel.tsx b/gui/src/renderer/components/ConnectionPanel.tsx index d0b0098d50..53b17153eb 100644 --- a/gui/src/renderer/components/ConnectionPanel.tsx +++ b/gui/src/renderer/components/ConnectionPanel.tsx @@ -36,6 +36,7 @@ interface IProps { hostname?: string; bridgeHostname?: string; inAddress?: IInAddress; + entryLocationInAddress?: IInAddress; bridgeInfo?: IBridgeData; outAddress?: IOutAddress; onToggle: () => void; @@ -72,8 +73,8 @@ const Header = styled.div({ export default class ConnectionPanel extends React.Component<IProps> { public render() { - const { inAddress, outAddress, bridgeInfo } = this.props; - const entryPoint = bridgeInfo && inAddress ? bridgeInfo : inAddress; + const { outAddress } = this.props; + const entryPoint = this.getEntryPoint(); return ( <div className={this.props.className}> @@ -117,6 +118,18 @@ export default class ConnectionPanel extends React.Component<IProps> { ); } + private getEntryPoint() { + const { inAddress, entryLocationInAddress, bridgeInfo } = this.props; + + if (entryLocationInAddress && inAddress) { + return entryLocationInAddress; + } else if (bridgeInfo && inAddress) { + return bridgeInfo; + } else { + return inAddress; + } + } + private hostnameLine() { if (this.props.hostname && this.props.bridgeHostname) { return sprintf( |
