feat: detect stable or insiders
This commit is contained in:
parent
7db6c051b4
commit
73a0f509db
2 changed files with 4 additions and 3 deletions
|
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue