Skip to content

Commit bf4e142

Browse files
authored
Merge pull request #8 from DevExpress-Examples/24.2_fix-refresh-button-rendering
24.2 fix refresh button rendering
2 parents bcac321 + bc4a37a commit bf4e142

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CS/ReportingApp/wwwroot/js/aiIntegration.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,23 @@ const createAssistantTab = (function() {
116116
stylingMode: 'text',
117117
onClick: () => refreshAnswer(data.component)
118118
});
119-
buttonContainer.appendChild(refreshBtnElement);
120-
lastRefreshButton = refreshBtnElement;
119+
if(data.component.option('items').at(-1).author === assistant.name) {
120+
buttonContainer.appendChild(refreshBtnElement);
121+
lastRefreshButton = refreshBtnElement;
122+
}
121123
container.appendChild(buttonContainer);
122124
},
123125
onMessageEntered: async (e) => {
126+
lastRefreshButton?.remove();
124127
const instance = e.component;
125128
instance.option('alerts', []);
126129
instance.renderMessage(e.message);
127130
instance.option({ typingUsers: [assistant] });
128131
const userInput = e.message.text;
129-
const response = await getAIResponse(instance, userInput, assistant.id ?? model.chatId);
132+
if(!assistant.id && model.chatId) {
133+
assistant.id = model.chatId;
134+
}
135+
const response = await getAIResponse(instance, userInput, assistant.id);
130136
RenderAssistantMessage(instance, response);
131137
}
132138
};

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<!-- default badges list -->
2-
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/853003889/24.2.6%2B)
32
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1252182)
43
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
54
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)

0 commit comments

Comments
 (0)