diff --git a/components/buffer-header.js b/components/buffer-header.js index 30552a6..bb155ed 100644 --- a/components/buffer-header.js +++ b/components/buffer-header.js @@ -38,7 +38,12 @@ export default function BufferHeader(props) { props.onManageNetwork(); } - let description = null, actions = null; + let fullyConnected = props.server.status === ServerStatus.REGISTERED; + if (props.bouncerNetwork) { + fullyConnected = fullyConnected && props.bouncerNetwork.state === "connected"; + } + + let description = null, actions = []; switch (props.buffer.type) { case BufferType.SERVER: switch (props.server.status) { @@ -74,43 +79,52 @@ export default function BufferHeader(props) { break; } + let joinButton = html` + + `; + if (props.isBouncer) { if (props.server.isupport.get("BOUNCER_NETID")) { - actions = html` - - - `; + if (fullyConnected) { + actions.push(joinButton); + actions.push(html` + + `); + } } else { - actions = html` - + if (fullyConnected) { + actions.push(html` + + `); + } + actions.push(html` - `; + `); } } else { - actions = html` - + if (fullyConnected) { + actions.push(joinButton); + } + actions.push(html` - `; + `); } break; case BufferType.CHANNEL: @@ -126,11 +140,15 @@ export default function BufferHeader(props) { >Leave `; } else { + if (fullyConnected) { + actions.push(html` + + `); + } actions = html` -