From 4acacc1f22b36bf0d1e2614b7c1b69f4b4e5ca9b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 22 Jan 2021 10:49:08 +0100 Subject: [PATCH] Nuke DEFAULT_NETWORK --- components/app.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/app.js b/components/app.js index 814d731..26eba05 100644 --- a/components/app.js +++ b/components/app.js @@ -163,6 +163,7 @@ export default class App extends Component { buffer = createRef(); composer = createRef(); reconnectTimeoutID = null; + lastNetworkID = 0; lastBufferID = 0; constructor(props) { @@ -437,7 +438,12 @@ export default class App extends Component { } connect(netID, params) { - this.disconnect(netID); + if (netID) { + this.disconnect(netID); + } else { + this.lastNetworkID++; + netID = this.lastNetworkID; + } this.setState((state) => { var networks = new Map(state.networks); @@ -725,7 +731,7 @@ export default class App extends Component { } } - this.connect(DEFAULT_NETWORK, connectParams); + this.connect(null, connectParams); } handleNickClick(nick) { @@ -961,7 +967,7 @@ export default class App extends Component { componentDidMount() { if (this.state.connectParams.autoconnect) { - this.connect(DEFAULT_NETWORK, this.state.connectParams); + this.connect(null, this.state.connectParams); } setupKeybindings(this);