mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Hide chat tips when chat quota is exceeded (#295249)
This commit is contained in:
@@ -608,6 +608,11 @@ export class ChatTipService extends Disposable implements IChatTipService {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't show tips when chat quota is exceeded, the upgrade widget is more relevant
|
||||||
|
if (this._isChatQuotaExceeded(contextKeyService)) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
// Return the already-shown tip for stable rerenders
|
// Return the already-shown tip for stable rerenders
|
||||||
if (this._tipRequestId === 'welcome' && this._shownTip) {
|
if (this._tipRequestId === 'welcome' && this._shownTip) {
|
||||||
return this._createTip(this._shownTip);
|
return this._createTip(this._shownTip);
|
||||||
@@ -722,6 +727,10 @@ export class ChatTipService extends Disposable implements IChatTipService {
|
|||||||
return !location || location === ChatAgentLocation.Chat;
|
return !location || location === ChatAgentLocation.Chat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _isChatQuotaExceeded(contextKeyService: IContextKeyService): boolean {
|
||||||
|
return contextKeyService.getContextKeyValue<boolean>(ChatContextKeys.chatQuotaExceeded.key) === true;
|
||||||
|
}
|
||||||
|
|
||||||
private _isCopilotEnabled(): boolean {
|
private _isCopilotEnabled(): boolean {
|
||||||
const defaultChatAgent = this._productService.defaultChatAgent;
|
const defaultChatAgent = this._productService.defaultChatAgent;
|
||||||
return !!defaultChatAgent?.chatExtensionId;
|
return !!defaultChatAgent?.chatExtensionId;
|
||||||
|
|||||||
Reference in New Issue
Block a user