Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
laileni-aws committed Oct 11, 2024
1 parent 4ca2ecd commit b375876
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/core/src/amazonq/webview/ui/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const createMynahUI = (
// eslint-disable-next-line prefer-const
let connector: Connector
//Store the mapping between messageId and messageUserIntent for amazonq_interactWithMessage telemetry
const messageUserIntentMap = new Map<string, string[]>()
const responseMetadata = new Map<string, string[]>()

window.addEventListener('error', (e) => {
const { error, message } = e
Expand Down Expand Up @@ -257,7 +257,7 @@ export const createMynahUI = (
item.userIntent !== undefined &&
item.codeBlockLanguage !== undefined
) {
messageUserIntentMap.set(item.messageId, [item.userIntent, item.codeBlockLanguage])
responseMetadata.set(item.messageId, [item.userIntent, item.codeBlockLanguage])
}
ideApi.postMessage({
command: 'update-chat-message-telemetry',
Expand Down Expand Up @@ -519,8 +519,8 @@ export const createMynahUI = (
eventId,
codeBlockIndex,
totalCodeBlocks,
messageUserIntentMap.get(messageId)?.[0] ?? undefined,
messageUserIntentMap.get(messageId)?.[1] ?? undefined
responseMetadata.get(messageId)?.[0] ?? undefined,
responseMetadata.get(messageId)?.[1] ?? undefined
)
},
onCodeBlockActionClicked: (
Expand Down Expand Up @@ -587,8 +587,8 @@ export const createMynahUI = (
eventId,
codeBlockIndex,
totalCodeBlocks,
messageUserIntentMap.get(messageId)?.[0] ?? undefined,
messageUserIntentMap.get(messageId)?.[1] ?? undefined
responseMetadata.get(messageId)?.[0] ?? undefined,
responseMetadata.get(messageId)?.[1] ?? undefined
)
mynahUI.notify({
type: NotificationType.SUCCESS,
Expand Down

0 comments on commit b375876

Please sign in to comment.