add hide timestamp to rpc code

This commit is contained in:
Amaru8 2022-05-02 12:40:54 +02:00 committed by GitHub
parent 565ff5c1a6
commit 76a6b14565
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -223,11 +223,13 @@ export default class DiscordRPC {
] //To change attributes.url => preload/cider-preload.js ] //To change attributes.url => preload/cider-preload.js
} }
// Add the timestamp if its playing // Add the timestamp if its playing and people want them
if (!this._utils.getStoreValue("general.discordrpc.hide_timestamp")) {
if (attributes.status) { if (attributes.status) {
this._activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime) this._activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime)
this._activity.endTimestamp = attributes.endTime this._activity.endTimestamp = attributes.endTime
} }
}
// If the user wants to keep the activity when paused // If the user wants to keep the activity when paused
if (!this._utils.getStoreValue("general.discordrpc.clear_on_pause")) { if (!this._utils.getStoreValue("general.discordrpc.clear_on_pause")) {