From 73a0f509db80f633390887430528832e74bbfe50 Mon Sep 17 00:00:00 2001 From: iCrawl Date: Sun, 26 Nov 2017 22:16:11 +0100 Subject: [PATCH] feat: detect stable or insiders --- package.json | 2 +- src/extension.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1cba9f5..0f07644 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ }, "discord.smallImage": { "type": "string", - "default": "Visual Studio Code", + "default": "{appname}", "description": "Custom string for the smallImageText section of the rich presence" } } diff --git a/src/extension.ts b/src/extension.ts index 4876a6b..a36ed87 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -3,6 +3,7 @@ import { Client } from 'discord-rpc'; import { basename, extname } from 'path'; import { setInterval, clearInterval } from 'timers'; import { + env, ExtensionContext, commands, window, @@ -183,8 +184,8 @@ function setActivity(): void { largeImageText: window.activeTextEditor ? config.get('largeImage') || window.activeTextEditor.document.languageId : config.get('largeImageIdle'), - smallImageKey: 'vscode', - smallImageText: config.get('smallImage'), + smallImageKey: env.appName.includes('Insiders') ? 'vscode-insiders' : 'vscode', + smallImageText: config.get('smallImage').replace('{appname}', env.appName), instance: false }; }