mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-09-06 18:45:05 -05:00
Fix listing available Discord clients never disconnects
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user