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", "name": "discord-vscode",
"version": "5.3.0", "version": "5.4.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "5.3.0", "version": "5.4.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"bufferutil": "^4.0.3", "bufferutil": "^4.0.3",

View file

@ -1,7 +1,7 @@
{ {
"name": "discord-vscode", "name": "discord-vscode",
"displayName": "Discord Presence", "displayName": "Discord Presence",
"version": "5.3.0", "version": "5.4.0",
"description": "Update your discord status with a rich presence.", "description": "Update your discord status with a rich presence.",
"private": true, "private": true,
"author": { "author": {
@ -139,6 +139,11 @@
"type": "boolean", "type": "boolean",
"default": false, "default": false,
"description": "Removes the lower details" "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 details: removeDetails
? undefined ? undefined
: await details(CONFIG_KEYS.DetailsIdling, CONFIG_KEYS.DetailsEditing, CONFIG_KEYS.DetailsDebugging), : 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, largeImageKey: IDLE_IMAGE_KEY,
largeImageText: defaultLargeImageText, largeImageText: defaultLargeImageText,
smallImageKey: defaultSmallImageKey, smallImageKey: defaultSmallImageKey,

View file

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

View file

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