diff --git a/package.json b/package.json index 3e39b0f..3a2e2f5 100644 --- a/package.json +++ b/package.json @@ -1914,8 +1914,7 @@ "suppressGitDisabledWarning": false, "suppressGitVersionWarning": false, "suppressLineUncommittedWarning": false, - "suppressNoRepositoryWarning": false, - "suppressSupportGitLensNotification": false + "suppressNoRepositoryWarning": false }, "properties": { "suppressCommitHasNoPreviousCommitWarning": { @@ -1945,10 +1944,6 @@ "suppressNoRepositoryWarning": { "type": "boolean", "default": false - }, - "suppressSupportGitLensNotification": { - "type": "boolean", - "default": false } }, "markdownDescription": "Specifies which messages should be suppressed", @@ -2118,7 +2113,7 @@ "commands": [ { "command": "gitlens.supportGitLens", - "title": "Sponsor GitLens ❤", + "title": "Sponsor GitLens", "category": "GitLens", "icon": "$(heart)" }, @@ -4835,34 +4830,34 @@ "group": "1_gitlens@0" }, { - "command": "gitlens.supportGitLens", - "when": "view =~ /^gitlens\\.views\\..*:/ && config.gitlens.advanced.messages.suppressSupportGitLensNotification != true && gitlens:views:supportGitLens:hide != true", - "group": "navigation@1" - }, - { "command": "gitlens.showSettingsPage#repositories-view", "when": "view =~ /^gitlens\\.views\\.repositories:/", - "group": "9_gitlens" + "group": "9_gitlens@1" }, { "command": "gitlens.showSettingsPage#file-history-view", "when": "view =~ /^gitlens\\.views\\.fileHistory:/", - "group": "9_gitlens" + "group": "9_gitlens@1" }, { "command": "gitlens.showSettingsPage#line-history-view", "when": "view =~ /^gitlens\\.views\\.lineHistory:/", - "group": "9_gitlens" + "group": "9_gitlens@1" }, { "command": "gitlens.showSettingsPage#search-commits-view", "when": "view =~ /^gitlens\\.views\\.search:/", - "group": "9_gitlens" + "group": "9_gitlens@1" }, { "command": "gitlens.showSettingsPage", "when": "view =~ /^gitlens\\.views\\.compare:/", - "group": "9_gitlens" + "group": "9_gitlens@1" + }, + { + "command": "gitlens.supportGitLens", + "when": "view =~ /^gitlens\\.views\\..*:/", + "group": "9_gitlens@-1" } ], "view/item/context": [ diff --git a/src/commands/supportGitLens.ts b/src/commands/supportGitLens.ts index b47b198..1ea8a64 100644 --- a/src/commands/supportGitLens.ts +++ b/src/commands/supportGitLens.ts @@ -1,6 +1,6 @@ 'use strict'; +import { env, Uri } from 'vscode'; import { command, Command, Commands } from './common'; -import { Messages } from '../messages'; @command() export class SupportGitLensCommand extends Command { @@ -8,7 +8,7 @@ export class SupportGitLensCommand extends Command { super(Commands.SupportGitLens); } - execute() { - return Messages.showSupportGitLensMessage(); + async execute() { + await env.openExternal(Uri.parse('https://gitlens.amod.io/#sponsor')); } } diff --git a/src/config.ts b/src/config.ts index 0b01081..a92f49a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -273,7 +273,6 @@ export interface AdvancedConfig { suppressGitVersionWarning: boolean; suppressLineUncommittedWarning: boolean; suppressNoRepositoryWarning: boolean; - suppressSupportGitLensNotification: boolean; }; quickPick: { closeOnFocusOut: boolean; diff --git a/src/constants.ts b/src/constants.ts index 50eae5a..cf61888 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -41,7 +41,6 @@ export enum CommandContext { ViewsCanCompare = 'gitlens:views:canCompare', ViewsCanCompareFile = 'gitlens:views:canCompare:file', ViewsCompareKeepResults = 'gitlens:views:compare:keepResults', - ViewsHideSupportGitLens = 'gitlens:views:supportGitLens:hide', ViewsFileHistoryEditorFollowing = 'gitlens:views:fileHistory:editorFollowing', ViewsLineHistoryEditorFollowing = 'gitlens:views:lineHistory:editorFollowing', ViewsRepositoriesAutoRefresh = 'gitlens:views:repositories:autoRefresh', diff --git a/src/messages.ts b/src/messages.ts index 712c7ee..363cb0e 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,7 +1,6 @@ 'use strict'; import { ConfigurationTarget, env, MessageItem, Uri, window } from 'vscode'; import { configuration } from './configuration'; -import { CommandContext, setCommandContext } from './constants'; import { GitCommit } from './git/git'; import { Logger } from './logger'; @@ -13,7 +12,6 @@ export enum SuppressedMessages { GitVersionWarning = 'suppressGitVersionWarning', LineUncommittedWarning = 'suppressLineUncommittedWarning', NoRepositoryWarning = 'suppressNoRepositoryWarning', - SupportGitLensNotification = 'suppressSupportGitLensNotification', } export class Messages { @@ -96,31 +94,6 @@ export class Messages { ); } - static async showSupportGitLensMessage() { - const actions: MessageItem[] = [{ title: 'Sponsor GitLens' }]; - - const result = await Messages.showMessage( - 'info', - 'While GitLens is offered to everyone for free, if you find it useful, please consider [sponsoring](https://gitlens.amod.io/#sponsor) it. Thank you! ❤', - undefined, - null, - ...actions, - ); - - if (result != null) { - let uri; - if (result === actions[0]) { - uri = Uri.parse('https://gitlens.amod.io/#sponsor'); - } - - if (uri !== undefined) { - await setCommandContext(CommandContext.ViewsHideSupportGitLens, true); - await this.suppressedMessage(SuppressedMessages.SupportGitLensNotification); - await env.openExternal(uri); - } - } - } - static async showWhatsNewMessage(version: string) { const actions: MessageItem[] = [{ title: "What's New" }, { title: 'Release Notes' }, { title: '❤' }];