Skip to content

Commit 901dd69

Browse files
committed
Clean up end of function to check approval
1 parent 145ac18 commit 901dd69

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,13 +543,14 @@ export class LanguageModelToolsService extends Disposable implements ILanguageMo
543543
}],
544544
}
545545
});
546-
if (!promptResult.result) {
547-
await this._configurationService.updateValue(ChatConfiguration.GlobalAutoApprove, false);
548546

549-
} if (promptResult.result === true) {
550-
this._storageService.store(AutoApproveStorageKeys.GlobalAutoApproveOptIn, true, StorageScope.APPLICATION, StorageTarget.USER);
547+
if (promptResult.result !== true) {
548+
await this._configurationService.updateValue(ChatConfiguration.GlobalAutoApprove, false);
549+
return false;
551550
}
552-
return promptResult.result === true;
551+
552+
this._storageService.store(AutoApproveStorageKeys.GlobalAutoApproveOptIn, true, StorageScope.APPLICATION, StorageTarget.USER);
553+
return true;
553554
}
554555

555556
private cleanupCallDisposables(requestId: string | undefined, store: DisposableStore): void {

0 commit comments

Comments
 (0)