Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
iceljc committed Oct 7, 2024
1 parent 128959e commit 7880091
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/routes/chat/[agentId]/[conversationId]/chat-box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,17 @@
/** @param {import('$conversationTypes').ChatResponseModel} message */
function sendReceivedNotification(message) {
if (notificationTimeout) {
clearTimeout(notificationTimeout);
}
notificationText = message?.rich_content?.message?.text || message.text || '';
isDisplayNotification = true;
notificationTimeout = setTimeout(() => {
isDisplayNotification = false;
notificationText = '';
}, notificationText?.length > 200 ? 8000 : 3000);
if (isFrame) {
window.parent.postMessage({ action: ChatAction.ReceiveNotification, data: message }, "*");
}
Expand Down Expand Up @@ -442,17 +453,6 @@
/** @param {import('$conversationTypes').ChatResponseModel} message */
function onNotificationGenerated(message) {
if (notificationTimeout) {
clearTimeout(notificationTimeout);
}
notificationText = message?.rich_content?.message?.text || message.text || '';
isDisplayNotification = true;
notificationTimeout = setTimeout(() => {
isDisplayNotification = false;
notificationText = '';
}, notificationText?.length > 200 ? 8000 : 3000);
sendReceivedNotification(message);
}
Expand Down

0 comments on commit 7880091

Please sign in to comment.