diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-12-06 10:13:00 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-01-03 13:48:03 +0100 |
| commit | ace538ae171575e66cd3b76c65f13464f0edc92b (patch) | |
| tree | d446f077ce05beba2b193380334e15ad1444b0a8 /gui/src/renderer/components | |
| parent | b896f49438af2f482774a80f14b111c7c896f7be (diff) | |
| download | mullvadvpn-ace538ae171575e66cd3b76c65f13464f0edc92b.tar.xz mullvadvpn-ace538ae171575e66cd3b76c65f13464f0edc92b.zip | |
Show correct in IP when using multihop
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( |
