fix: don't throw errors if a reconnect is ongoing
This commit is contained in:
parent
a54dc0767a
commit
a3a2e47f58
1 changed files with 5 additions and 5 deletions
|
@ -81,11 +81,11 @@ function initRPC(clientID: string): void {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Log in to the RPC Client, and check whether or not it errors.
|
// Log in to the RPC Client, and check whether or not it errors.
|
||||||
rpc.login(clientID).catch(error =>
|
rpc.login(clientID).catch(error => {
|
||||||
error.message.includes('ENOENT')
|
if (reconnect) return;
|
||||||
? window.showErrorMessage('No Discord Client detected!')
|
if (error.message.includes('ENOENT')) window.showErrorMessage('No Discord Client detected!');
|
||||||
: window.showErrorMessage(`Could not connect to discord via rpc: ${error.message}`)
|
else window.showErrorMessage(`Could not connect to discord via rpc: ${error.message}`);
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanly destroy the RPC client (if it isn't already).
|
// Cleanly destroy the RPC client (if it isn't already).
|
||||||
|
|
Loading…
Reference in a new issue