From a172c810e95072411fbca60ac08db8d107e6abbf Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 30 Nov 2022 11:21:54 +0100 Subject: [PATCH] Make first server check more robust when disconnecting A disconnect/reconnect cycle will bump the server ID. --- components/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/app.js b/components/app.js index 29b24a0..5187df9 100644 --- a/components/app.js +++ b/components/app.js @@ -1414,6 +1414,7 @@ export default class App extends Component { }); let disconnectAll = client && !client.params.bouncerNetwork && client.caps.enabled.has("soju.im/bouncer-networks"); + let isFirstServer = this.state.servers.keys().next().value === buf.server; this.disconnect(buf.server); @@ -1439,7 +1440,7 @@ export default class App extends Component { } // TODO: only clear autoconnect if this server is stored there - if (buf.server == 1) { + if (isFirstServer) { store.autoconnect.put(null); } break;