Keep track of channel join status
This makes us behave better when we receive a self-PART message from the server.
This commit is contained in:
parent
7b19cf48a4
commit
800f5ceb6a
3 changed files with 44 additions and 13 deletions
|
@ -117,13 +117,27 @@ export default function BufferHeader(props) {
|
|||
if (props.buffer.topic) {
|
||||
description = linkify(stripANSI(props.buffer.topic), props.onChannelClick);
|
||||
}
|
||||
actions = html`
|
||||
<button
|
||||
key="part"
|
||||
class="danger"
|
||||
onClick=${handleCloseClick}
|
||||
>Leave</button>
|
||||
`;
|
||||
if (props.buffer.joined) {
|
||||
actions = html`
|
||||
<button
|
||||
key="part"
|
||||
class="danger"
|
||||
onClick=${handleCloseClick}
|
||||
>Leave</button>
|
||||
`;
|
||||
} else {
|
||||
actions = html`
|
||||
<button
|
||||
key="join"
|
||||
onClick=${handleJoinClick}
|
||||
>Join</button>
|
||||
<button
|
||||
key="part"
|
||||
class="danger"
|
||||
onClick=${handleCloseClick}
|
||||
>Close</button>
|
||||
`;
|
||||
}
|
||||
break;
|
||||
case BufferType.NICK:
|
||||
if (props.user) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue