Skip to content

Commit 23b4e53

Browse files
committed
Removes heart from views & simplifies sponsor cmd
1 parent 7167f81 commit 23b4e53

File tree

5 files changed

+15
-49
lines changed

5 files changed

+15
-49
lines changed

package.json

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,8 +1914,7 @@
19141914
"suppressGitDisabledWarning": false,
19151915
"suppressGitVersionWarning": false,
19161916
"suppressLineUncommittedWarning": false,
1917-
"suppressNoRepositoryWarning": false,
1918-
"suppressSupportGitLensNotification": false
1917+
"suppressNoRepositoryWarning": false
19191918
},
19201919
"properties": {
19211920
"suppressCommitHasNoPreviousCommitWarning": {
@@ -1945,10 +1944,6 @@
19451944
"suppressNoRepositoryWarning": {
19461945
"type": "boolean",
19471946
"default": false
1948-
},
1949-
"suppressSupportGitLensNotification": {
1950-
"type": "boolean",
1951-
"default": false
19521947
}
19531948
},
19541949
"markdownDescription": "Specifies which messages should be suppressed",
@@ -2118,7 +2113,7 @@
21182113
"commands": [
21192114
{
21202115
"command": "gitlens.supportGitLens",
2121-
"title": "Sponsor GitLens",
2116+
"title": "Sponsor GitLens",
21222117
"category": "GitLens",
21232118
"icon": "$(heart)"
21242119
},
@@ -4834,35 +4829,35 @@
48344829
"when": "view =~ /^gitlens\\.views\\.search:/ && config.gitlens.views.search.avatars",
48354830
"group": "1_gitlens@0"
48364831
},
4837-
{
4838-
"command": "gitlens.supportGitLens",
4839-
"when": "view =~ /^gitlens\\.views\\..*:/ && config.gitlens.advanced.messages.suppressSupportGitLensNotification != true && gitlens:views:supportGitLens:hide != true",
4840-
"group": "navigation@1"
4841-
},
48424832
{
48434833
"command": "gitlens.showSettingsPage#repositories-view",
48444834
"when": "view =~ /^gitlens\\.views\\.repositories:/",
4845-
"group": "9_gitlens"
4835+
"group": "9_gitlens@1"
48464836
},
48474837
{
48484838
"command": "gitlens.showSettingsPage#file-history-view",
48494839
"when": "view =~ /^gitlens\\.views\\.fileHistory:/",
4850-
"group": "9_gitlens"
4840+
"group": "9_gitlens@1"
48514841
},
48524842
{
48534843
"command": "gitlens.showSettingsPage#line-history-view",
48544844
"when": "view =~ /^gitlens\\.views\\.lineHistory:/",
4855-
"group": "9_gitlens"
4845+
"group": "9_gitlens@1"
48564846
},
48574847
{
48584848
"command": "gitlens.showSettingsPage#search-commits-view",
48594849
"when": "view =~ /^gitlens\\.views\\.search:/",
4860-
"group": "9_gitlens"
4850+
"group": "9_gitlens@1"
48614851
},
48624852
{
48634853
"command": "gitlens.showSettingsPage",
48644854
"when": "view =~ /^gitlens\\.views\\.compare:/",
4865-
"group": "9_gitlens"
4855+
"group": "9_gitlens@1"
4856+
},
4857+
{
4858+
"command": "gitlens.supportGitLens",
4859+
"when": "view =~ /^gitlens\\.views\\..*:/",
4860+
"group": "9_gitlens@-1"
48664861
}
48674862
],
48684863
"view/item/context": [

src/commands/supportGitLens.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
'use strict';
2+
import { env, Uri } from 'vscode';
23
import { command, Command, Commands } from './common';
3-
import { Messages } from '../messages';
44

55
@command()
66
export class SupportGitLensCommand extends Command {
77
constructor() {
88
super(Commands.SupportGitLens);
99
}
1010

11-
execute() {
12-
return Messages.showSupportGitLensMessage();
11+
async execute() {
12+
await env.openExternal(Uri.parse('https://gitlens.amod.io/#sponsor'));
1313
}
1414
}

src/config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ export interface AdvancedConfig {
273273
suppressGitVersionWarning: boolean;
274274
suppressLineUncommittedWarning: boolean;
275275
suppressNoRepositoryWarning: boolean;
276-
suppressSupportGitLensNotification: boolean;
277276
};
278277
quickPick: {
279278
closeOnFocusOut: boolean;

src/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export enum CommandContext {
4141
ViewsCanCompare = 'gitlens:views:canCompare',
4242
ViewsCanCompareFile = 'gitlens:views:canCompare:file',
4343
ViewsCompareKeepResults = 'gitlens:views:compare:keepResults',
44-
ViewsHideSupportGitLens = 'gitlens:views:supportGitLens:hide',
4544
ViewsFileHistoryEditorFollowing = 'gitlens:views:fileHistory:editorFollowing',
4645
ViewsLineHistoryEditorFollowing = 'gitlens:views:lineHistory:editorFollowing',
4746
ViewsRepositoriesAutoRefresh = 'gitlens:views:repositories:autoRefresh',

src/messages.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22
import { ConfigurationTarget, env, MessageItem, Uri, window } from 'vscode';
33
import { configuration } from './configuration';
4-
import { CommandContext, setCommandContext } from './constants';
54
import { GitCommit } from './git/git';
65
import { Logger } from './logger';
76

@@ -13,7 +12,6 @@ export enum SuppressedMessages {
1312
GitVersionWarning = 'suppressGitVersionWarning',
1413
LineUncommittedWarning = 'suppressLineUncommittedWarning',
1514
NoRepositoryWarning = 'suppressNoRepositoryWarning',
16-
SupportGitLensNotification = 'suppressSupportGitLensNotification',
1715
}
1816

1917
export class Messages {
@@ -96,31 +94,6 @@ export class Messages {
9694
);
9795
}
9896

99-
static async showSupportGitLensMessage() {
100-
const actions: MessageItem[] = [{ title: 'Sponsor GitLens' }];
101-
102-
const result = await Messages.showMessage(
103-
'info',
104-
'While GitLens is offered to everyone for free, if you find it useful, please consider [sponsoring](https://gitlens.amod.io/#sponsor) it. Thank you! ❤',
105-
undefined,
106-
null,
107-
...actions,
108-
);
109-
110-
if (result != null) {
111-
let uri;
112-
if (result === actions[0]) {
113-
uri = Uri.parse('https://gitlens.amod.io/#sponsor');
114-
}
115-
116-
if (uri !== undefined) {
117-
await setCommandContext(CommandContext.ViewsHideSupportGitLens, true);
118-
await this.suppressedMessage(SuppressedMessages.SupportGitLensNotification);
119-
await env.openExternal(uri);
120-
}
121-
}
122-
}
123-
12497
static async showWhatsNewMessage(version: string) {
12598
const actions: MessageItem[] = [{ title: "What's New" }, { title: 'Release Notes' }, { title: '❤' }];
12699

0 commit comments

Comments
 (0)