mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-17 17:25:51 -05:00
Adds welcome message for first-time users
This commit is contained in:
@@ -31,9 +31,10 @@ export const DocumentSchemes = {
|
||||
GitLensGit: 'gitlens-git' as DocumentSchemes
|
||||
};
|
||||
|
||||
export type WorkspaceState = 'repoPath' | 'suppressGitVersionWarning' | 'suppressUpdateNotice';
|
||||
export type WorkspaceState = 'repoPath' | 'suppressGitVersionWarning' | 'suppressUpdateNotice' | 'suppressWelcomeNotice';
|
||||
export const WorkspaceState = {
|
||||
GitLensVersion: 'gitlensVersion' as WorkspaceState,
|
||||
SuppressGitVersionWarning: 'suppressGitVersionWarning' as WorkspaceState,
|
||||
SuppressUpdateNotice: 'suppressUpdateNotice' as WorkspaceState
|
||||
SuppressUpdateNotice: 'suppressUpdateNotice' as WorkspaceState,
|
||||
SuppressWelcomeNotice: 'suppressWelcomeNotice' as WorkspaceState
|
||||
};
|
||||
@@ -129,6 +129,20 @@ async function notifyOnNewGitLensVersion(context: ExtensionContext, version: str
|
||||
|
||||
const previousVersion = context.globalState.get<string>(WorkspaceState.GitLensVersion);
|
||||
|
||||
if (!context.globalState.get(WorkspaceState.SuppressWelcomeNotice, false)) {
|
||||
await context.globalState.update(WorkspaceState.SuppressWelcomeNotice, true);
|
||||
|
||||
if (previousVersion === undefined) {
|
||||
const result = await window.showInformationMessage(`Thank you for choosing GitLens! GitLens is powerful, feature rich, and highly configurable, so please be sure to view the docs and tailor it to suit your needs.`, 'View Docs');
|
||||
if (result === 'View Docs') {
|
||||
// TODO: Reset before release
|
||||
// commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://marketplace.visualstudio.com/items/eamodio.gitlens'));
|
||||
commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://github.com/eamodio/vscode-gitlens/blob/develop/README.md'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await context.globalState.update(WorkspaceState.GitLensVersion, version);
|
||||
|
||||
if (previousVersion) {
|
||||
@@ -139,7 +153,9 @@ async function notifyOnNewGitLensVersion(context: ExtensionContext, version: str
|
||||
|
||||
const result = await window.showInformationMessage(`GitLens has been updated to v${version}`, 'View Release Notes', `Don't Show Again`);
|
||||
if (result === 'View Release Notes') {
|
||||
commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://marketplace.visualstudio.com/items/eamodio.gitlens/changelog'));
|
||||
// TODO: Reset before release
|
||||
// commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://marketplace.visualstudio.com/items/eamodio.gitlens/changelog'));
|
||||
commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://github.com/eamodio/vscode-gitlens/blob/develop/CHANGELOG.md'));
|
||||
}
|
||||
else if (result === `Don't Show Again`) {
|
||||
context.globalState.update(WorkspaceState.SuppressUpdateNotice, true);
|
||||
|
||||
Reference in New Issue
Block a user