Skip to content

Commit 3bfd937

Browse files
committed
replace disablePreviousFileList with session.disableFileList from controller
1 parent e02be21 commit 3bfd937

File tree

1 file changed

+3
-9
lines changed
  • packages/core/src/amazonqFeatureDev/controllers/chat

1 file changed

+3
-9
lines changed

packages/core/src/amazonqFeatureDev/controllers/chat/controller.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,6 @@ export class FeatureDevController {
350350
return
351351
}
352352

353-
await this.disablePreviousFileList(message.tabID)
354-
355353
/**
356354
* Don't attempt to process any chat messages when a workspace folder is not set.
357355
* When the tab is first opened we will throw an error and lock the chat if the workspace
@@ -367,6 +365,7 @@ export class FeatureDevController {
367365
getLogger().debug(`${featureName}: Processing message: ${message.message}`)
368366

369367
session = await this.sessionStorage.getSession(message.tabID)
368+
await session.disableFileList()
370369
const authState = await AuthUtil.instance.getChatAuthState()
371370
if (authState.amazonQ !== 'connected') {
372371
await this.messenger.sendAuthNeededExceptionMessage(authState, message.tabID)
@@ -602,11 +601,6 @@ export class FeatureDevController {
602601
}
603602
}
604603

605-
private async disablePreviousFileList(tabId: string) {
606-
const session = await this.sessionStorage.getSession(tabId)
607-
await session.disableFileList()
608-
}
609-
610604
private async provideFeedbackAndRegenerateCode(message: any) {
611605
const session = await this.sessionStorage.getSession(message.tabID)
612606
telemetry.amazonq_isProvideFeedbackForCodeGen.emit({
@@ -906,9 +900,9 @@ export class FeatureDevController {
906900
}
907901

908902
private async newTask(message: any) {
909-
await this.disablePreviousFileList(message.tabID)
910903
// Old session for the tab is ending, delete it so we can create a new one for the message id
911904
const session = await this.sessionStorage.getSession(message.tabID)
905+
await session.disableFileList()
912906
telemetry.amazonq_endChat.emit({
913907
amazonqConversationId: session.conversationId,
914908
amazonqEndOfTheConversationLatency: performance.now() - session.telemetry.sessionStartTime,
@@ -924,7 +918,6 @@ export class FeatureDevController {
924918
}
925919

926920
private async closeSession(message: any) {
927-
await this.disablePreviousFileList(message.tabID)
928921
this.messenger.sendAnswer({
929922
type: 'answer',
930923
tabID: message.tabID,
@@ -934,6 +927,7 @@ export class FeatureDevController {
934927
this.messenger.sendChatInputEnabled(message.tabID, false)
935928

936929
const session = await this.sessionStorage.getSession(message.tabID)
930+
await session.disableFileList()
937931
telemetry.amazonq_endChat.emit({
938932
amazonqConversationId: session.conversationId,
939933
amazonqEndOfTheConversationLatency: performance.now() - session.telemetry.sessionStartTime,

0 commit comments

Comments
 (0)