mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-04-25 07:27:19 -05:00
Fix listing available Discord clients never disconnects
This commit is contained in:
parent
28492f1dad
commit
5379cdd805
|
|
@ -153,8 +153,12 @@ export function setupIpc(appinstance: App, ipcMain: IpcMain) {
|
|||
const users: User[] = [];
|
||||
|
||||
for (const client of await getDiscordRpcClients()) {
|
||||
await client.connect(defaultTitle.client);
|
||||
if (client.user && !users.find(u => u.id === client.user!.id)) users.push(client.user);
|
||||
try {
|
||||
await client.connect(defaultTitle.client);
|
||||
if (client.user && !users.find(u => u.id === client.user!.id)) users.push(client.user);
|
||||
} finally {
|
||||
await client.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
return users;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user