From 576b9d51eb9e8ebfd6051a335031c9c397650c5a Mon Sep 17 00:00:00 2001 From: Umar Getagazov Date: Wed, 11 May 2022 15:27:51 +0700 Subject: [PATCH] components/app: switch to server buffer on close only if active If the buffer that's being closed is not the active one, there's no point in switching the user away to another buffer. --- components/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/app.js b/components/app.js index 3c1f2a6..5de8b76 100644 --- a/components/app.js +++ b/components/app.js @@ -1298,7 +1298,9 @@ export default class App extends Component { } // fallthrough case BufferType.NICK: - this.switchBuffer({ name: SERVER_BUFFER }); + if (this.state.activeBuffer === buf.id) { + this.switchBuffer({ name: SERVER_BUFFER }); + } this.setState((state) => { let buffers = new Map(state.buffers); buffers.delete(buf.id);