feat: detect stable or insiders

This commit is contained in:
iCrawl 2017-11-26 22:16:11 +01:00
parent 7db6c051b4
commit 73a0f509db
No known key found for this signature in database
GPG key ID: E41A6DB922EC2CFE
2 changed files with 4 additions and 3 deletions

View file

@ -91,7 +91,7 @@
}, },
"discord.smallImage": { "discord.smallImage": {
"type": "string", "type": "string",
"default": "Visual Studio Code", "default": "{appname}",
"description": "Custom string for the smallImageText section of the rich presence" "description": "Custom string for the smallImageText section of the rich presence"
} }
} }

View file

@ -3,6 +3,7 @@ import { Client } from 'discord-rpc';
import { basename, extname } from 'path'; import { basename, extname } from 'path';
import { setInterval, clearInterval } from 'timers'; import { setInterval, clearInterval } from 'timers';
import { import {
env,
ExtensionContext, ExtensionContext,
commands, commands,
window, window,
@ -183,8 +184,8 @@ function setActivity(): void {
largeImageText: window.activeTextEditor largeImageText: window.activeTextEditor
? config.get('largeImage') || window.activeTextEditor.document.languageId ? config.get('largeImage') || window.activeTextEditor.document.languageId
: config.get('largeImageIdle'), : config.get('largeImageIdle'),
smallImageKey: 'vscode', smallImageKey: env.appName.includes('Insiders') ? 'vscode-insiders' : 'vscode',
smallImageText: config.get('smallImage'), smallImageText: config.get('smallImage').replace('{appname}', env.appName),
instance: false instance: false
}; };
} }