feat: remove timestamp

This commit is contained in:
iCrawl 2021-02-26 20:01:36 +01:00
parent 4ddbe087ed
commit e6d3e4db78
No known key found for this signature in database
GPG key ID: 1AB888B16355FBB2
5 changed files with 11 additions and 4 deletions

4
package-lock.json generated
View file

@ -1,11 +1,11 @@
{
"name": "discord-vscode",
"version": "5.3.0",
"version": "5.4.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "5.3.0",
"version": "5.4.0",
"license": "MIT",
"dependencies": {
"bufferutil": "^4.0.3",

View file

@ -1,7 +1,7 @@
{
"name": "discord-vscode",
"displayName": "Discord Presence",
"version": "5.3.0",
"version": "5.4.0",
"description": "Update your discord status with a rich presence.",
"private": true,
"author": {
@ -139,6 +139,11 @@
"type": "boolean",
"default": false,
"description": "Removes the lower details"
},
"discord.removeTimestamp": {
"type": "boolean",
"default": false,
"description": "Removes the timestamp"
}
}
}

View file

@ -55,7 +55,7 @@ export async function activity(previous: ActivityPayload = {}) {
details: removeDetails
? undefined
: await details(CONFIG_KEYS.DetailsIdling, CONFIG_KEYS.DetailsEditing, CONFIG_KEYS.DetailsDebugging),
startTimestamp: previous.startTimestamp ?? Date.now(),
startTimestamp: config[CONFIG_KEYS.RemoveTimestamp] ? undefined : previous.startTimestamp ?? Date.now(),
largeImageKey: IDLE_IMAGE_KEY,
largeImageText: defaultLargeImageText,
smallImageKey: defaultSmallImageKey,

View file

@ -55,4 +55,5 @@ export const enum CONFIG_KEYS {
SwapBigAndSmallImage = 'swapBigAndSmallImage',
RemoveDetails = 'removeDetails',
RemoveLowerDetails = 'removeLowerDetails',
RemoveTimestamp = 'removeTimestamp',
}

View file

@ -20,6 +20,7 @@ type WorkspaceExtensionConfiguration = WorkspaceConfiguration & {
swapBigAndSmallImage: boolean;
removeDetails: boolean;
removeLowerDetails: boolean;
removeTimestamp: boolean;
};
export function getConfig() {