mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-14 19:05:01 -05:00
Only switch to autojoin channel once
This commit is contained in:
parent
f943d8ea15
commit
07c10b3b1f
1 changed files with 7 additions and 2 deletions
|
@ -171,6 +171,7 @@ export default class App extends Component {
|
|||
composer = createRef();
|
||||
lastNetworkID = 0;
|
||||
lastBufferID = 0;
|
||||
switchToChannel = null;
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
@ -507,6 +508,10 @@ export default class App extends Component {
|
|||
if (!this.state.activeBuffer) {
|
||||
this.switchBuffer({ network: netID, name: SERVER_BUFFER });
|
||||
}
|
||||
|
||||
if (params.autojoin.length > 0) {
|
||||
this.switchToChannel = params.autojoin[0];
|
||||
}
|
||||
}
|
||||
|
||||
disconnect(netID) {
|
||||
|
@ -637,9 +642,9 @@ export default class App extends Component {
|
|||
if (msg.prefix.name != client.nick) {
|
||||
this.addMessage(netID, channel, msg);
|
||||
}
|
||||
if (channel == this.state.connectParams.autojoin[0]) {
|
||||
// TODO: only switch once right after connect
|
||||
if (channel == this.switchToChannel) {
|
||||
this.switchBuffer({ network: netID, name: channel });
|
||||
this.switchToChannel = null;
|
||||
}
|
||||
|
||||
var receipt = this.getReceipt(channel, ReceiptType.READ);
|
||||
|
|
Loading…
Reference in a new issue