File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
src/routes/chat/[agentId]/[conversationId] Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change 262262
263263 /** @param {import('$conversationTypes').ChatResponseModel} message */
264264 function sendReceivedNotification (message ) {
265+ if (notificationTimeout) {
266+ clearTimeout (notificationTimeout);
267+ }
268+
269+ notificationText = message? .rich_content ? .message ? .text || message .text || ' ' ;
270+ isDisplayNotification = true ;
271+ notificationTimeout = setTimeout (() => {
272+ isDisplayNotification = false ;
273+ notificationText = ' ' ;
274+ }, notificationText? .length > 200 ? 8000 : 3000 );
275+
265276 if (isFrame) {
266277 window .parent .postMessage ({ action: ChatAction .ReceiveNotification , data: message }, " *" );
267278 }
442453
443454 /** @param {import('$conversationTypes').ChatResponseModel} message */
444455 function onNotificationGenerated (message ) {
445- if (notificationTimeout) {
446- clearTimeout (notificationTimeout);
447- }
448-
449- notificationText = message? .rich_content ? .message ? .text || message .text || ' ' ;
450- isDisplayNotification = true ;
451- notificationTimeout = setTimeout (() => {
452- isDisplayNotification = false ;
453- notificationText = ' ' ;
454- }, notificationText? .length > 200 ? 8000 : 3000 );
455-
456456 sendReceivedNotification (message);
457457 }
458458
You can’t perform that action at this time.
0 commit comments