Added discordrpc activity cache check to prevent unnecessary calls

This commit is contained in:
Core 2022-04-20 00:26:05 +01:00
parent 5d375b95cd
commit e2b9b0763f
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6

View file

@ -179,7 +179,7 @@ export default class DiscordRPC {
// Set the activity // Set the activity
if (!this._attributes.status && this._utils.getStoreValue("general.discord_rpc.clear_on_pause")) { if (!this._attributes.status && this._utils.getStoreValue("general.discord_rpc.clear_on_pause")) {
this._client.clearActivity() this._client.clearActivity()
} else { } else if (this._activity && this._activityCache !== this._activity && this._activity.details) {
this._client.setActivity(activity) this._client.setActivity(activity)
this._activityCache = this._activity; this._activityCache = this._activity;
} }