Reload function

This commit is contained in:
Core 2022-06-03 12:38:51 +01:00
parent adf1a18be7
commit ccd152572c
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6

View file

@ -70,6 +70,7 @@ export default class DiscordRPC {
})
}
})
ipcMain.on("reloadRPC", () => this.reload())
}
/**
@ -257,4 +258,14 @@ export default class DiscordRPC {
}
return activity
}
/**
* Reloads DiscordRPC
*/
private reload() {
if (this._client) {
this._client.destroy()
}
this.connect()
}
}