Skip to content

Commit d89345c

Browse files
committed
Disable the revert button when committing changes
1 parent 7b8abc7 commit d89345c

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

packages/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat (CWC)",
44
"description": "Connect VS Code with free chatbots",
5-
"version": "1.252.0",
5+
"version": "1.253.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

packages/vscode/src/commands/commit-changes-command.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import {
1111
get_commit_message_config
1212
} from '../utils/commit-message-generator'
1313

14-
export function commit_changes_command(context: vscode.ExtensionContext) {
14+
export function commit_changes_command(
15+
context: vscode.ExtensionContext,
16+
set_revert_button_state: (can_revert: boolean) => void
17+
) {
1518
return vscode.commands.registerCommand(
1619
'codeWebChat.commitChanges',
1720
async (source_control?: vscode.SourceControl) => {
@@ -36,6 +39,8 @@ export function commit_changes_command(context: vscode.ExtensionContext) {
3639

3740
if (!commit_message) return
3841

42+
set_revert_button_state(false)
43+
3944
try {
4045
execSync(`git commit -m "${commit_message.replace(/"/g, '\\"')}"`, {
4146
cwd: repository.rootUri.fsPath

packages/vscode/src/extension.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export async function activate(context: vscode.ExtensionContext) {
101101
context,
102102
view_provider.set_revert_button_state,
103103
view_provider.set_apply_button_state
104-
)
104+
),
105+
commit_changes_command(context, view_provider.set_revert_button_state)
105106
)
106107
}
107108

@@ -120,9 +121,7 @@ export async function activate(context: vscode.ExtensionContext) {
120121
rename_command(),
121122
delete_command(),
122123
save_context_command(workspace_provider, context),
123-
124124
generate_commit_message_command(context),
125-
commit_changes_command(context),
126125
open_url_command({
127126
command: 'codeWebChat.openRepository',
128127
url: 'https://github.com/robertpiosik/CodeWebChat'

0 commit comments

Comments
 (0)