Skip to content

Commit

Permalink
Destroy old rpc if it exists
Browse files Browse the repository at this point in the history
Signed-off-by: Sahil Gupte <[email protected]>
  • Loading branch information
Ovenoboyo committed Apr 11, 2022
1 parent 110b923 commit a031721
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/rpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const clientID = '867757838679670784'
let rpc: ClientRPC | undefined

export function login(onCloseCallback: () => void) {
if (rpc) rpc.destroy()
rpc = new ClientRPC(clientID, { transport: 'ipc' })
return new Promise<void>((resolve, reject) => {
rpc.once('ready', resolve)
Expand Down

0 comments on commit a031721

Please sign in to comment.