Add Client.join, show join errors in popup

This commit is contained in:
Simon Ser 2021-12-04 17:44:23 +01:00
parent fc8aa30756
commit 05f7c6e9fe
3 changed files with 36 additions and 2 deletions

View file

@ -318,7 +318,7 @@ export default class App extends Component {
}
showError(msg) {
this.setState({ error: msg });
this.setState({ error: String(msg) });
lastErrorID++;
return lastErrorID;
}
@ -1119,7 +1119,9 @@ export default class App extends Component {
this.switchBuffer({ server: serverID });
} else if (client.isChannel(target)) {
this.switchToChannel = target;
client.send({ command: "JOIN", params: [target] });
client.join(target).catch((err) => {
this.showError(err);
});
} else {
this.whoUserBuffer(target, serverID);
this.createBuffer(serverID, target);