mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-14 19:05:01 -05:00
components/app: prevent multiple WHO channel commands in parallel
References: https://todo.sr.ht/~emersion/gamja/152
This commit is contained in:
parent
535bdb2f52
commit
2d651ef901
1 changed files with 11 additions and 3 deletions
|
@ -1373,10 +1373,18 @@ export default class App extends Component {
|
|||
async whoChannelBuffer(target, serverID) {
|
||||
let client = this.clients.get(serverID);
|
||||
|
||||
// Prevent multiple WHO commands for the same channel in parallel
|
||||
this.setBufferState({ name: target, server: serverID }, { hasInitialWho: true });
|
||||
|
||||
let hasInitialWho = false;
|
||||
try {
|
||||
await client.who(target, {
|
||||
fields: ["flags", "hostname", "nick", "realname", "username", "account"],
|
||||
});
|
||||
this.setBufferState({ name: target, server: serverID }, { hasInitialWho: true });
|
||||
hasInitialWho = true;
|
||||
} finally {
|
||||
this.setBufferState({ name: target, server: serverID }, { hasInitialWho });
|
||||
}
|
||||
}
|
||||
|
||||
open(target, serverID, password) {
|
||||
|
|
Loading…
Reference in a new issue