mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-28 18:26:19 -05:00
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:
parent
6b04cb1417
commit
576b9d51eb
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue