forked from CringeStudios/gamja
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
@ -1373,10 +1373,18 @@ export default class App extends Component {
|
|||||||
async whoChannelBuffer(target, serverID) {
|
async whoChannelBuffer(target, serverID) {
|
||||||
let client = this.clients.get(serverID);
|
let client = this.clients.get(serverID);
|
||||||
|
|
||||||
await client.who(target, {
|
// Prevent multiple WHO commands for the same channel in parallel
|
||||||
fields: ["flags", "hostname", "nick", "realname", "username", "account"],
|
|
||||||
});
|
|
||||||
this.setBufferState({ name: target, server: serverID }, { hasInitialWho: true });
|
this.setBufferState({ name: target, server: serverID }, { hasInitialWho: true });
|
||||||
|
|
||||||
|
let hasInitialWho = false;
|
||||||
|
try {
|
||||||
|
await client.who(target, {
|
||||||
|
fields: ["flags", "hostname", "nick", "realname", "username", "account"],
|
||||||
|
});
|
||||||
|
hasInitialWho = true;
|
||||||
|
} finally {
|
||||||
|
this.setBufferState({ name: target, server: serverID }, { hasInitialWho });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open(target, serverID, password) {
|
open(target, serverID, password) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user