Use buffer ID in BufferItem.onBufferClick

This commit is contained in:
Simon Ser 2021-01-22 21:43:58 +01:00
parent 0e078932c0
commit bfc0960200
2 changed files with 3 additions and 3 deletions

View file

@ -821,8 +821,8 @@ export default class App extends Component {
this.privmsg(buf.name, text);
}
handleBufferListClick(name) {
this.switchBuffer({ name });
handleBufferListClick(id) {
this.switchBuffer(id);
}
handleJoinClick(event) {

View file

@ -49,7 +49,7 @@ export default function BufferList(props) {
return html`
<ul>
${Array.from(props.buffers.values()).map((buf) => html`
<${BufferItem} key=${buf.id} buffer=${buf} network=${props.networks.get(buf.network)} onClick=${() => props.onBufferClick(buf.name)} active=${props.activeBuffer == buf.id}/>
<${BufferItem} key=${buf.id} buffer=${buf} network=${props.networks.get(buf.network)} onClick=${() => props.onBufferClick(buf)} active=${props.activeBuffer == buf.id}/>
`)}
</ul>
`;