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.
This commit is contained in:
committed by
Simon Ser
parent
6b04cb1417
commit
576b9d51eb
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user