Skip to content

Commit 0f51dac

Browse files
committed
minor change
1 parent 5ee7678 commit 0f51dac

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/routes/chat/[agentId]/[conversationId]/chat-box.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@
508508
autoScrollLog = true;
509509
clearInstantLogs();
510510
renewUserSentMessages(msgText);
511+
const agentId = params.agentId;
512+
const convId = conversationId || params.conversationId;
511513
512514
let postback = data?.postback;
513515
if (!postback) {
@@ -530,7 +532,7 @@
530532
if (files?.length > 0 && !!!messageData.inputMessageId) {
531533
const filePayload = buildFilePayload(files);
532534
return new Promise((resolve, reject) => {
533-
uploadConversationFiles(params.agentId, conversationId || params.conversationId, files).then(resMessageId => {
535+
uploadConversationFiles(agentId, convId, files).then(resMessageId => {
534536
messageData = { ...messageData, inputMessageId: resMessageId };
535537
if (!!filePayload) {
536538
messageData = {
@@ -543,7 +545,7 @@
543545
};
544546
}
545547
546-
sendMessageToHub(params.agentId, conversationId || params.conversationId, msgText, messageData).then(res => {
548+
sendMessageToHub(agentId, convId, msgText, messageData).then(res => {
547549
resolve(res);
548550
}).catch(err => {
549551
reject(err);
@@ -556,7 +558,7 @@
556558
} else {
557559
return new Promise((resolve, reject) => {
558560
if (!!messageData?.inputMessageId) {
559-
getConversationFiles(params.conversationId, messageData.inputMessageId, FileSourceType.User).then(retFiles => {
561+
getConversationFiles(convId, messageData.inputMessageId, FileSourceType.User).then(retFiles => {
560562
const filePayload = buildFilePayload(retFiles);
561563
if (!!filePayload) {
562564
messageData = {
@@ -569,7 +571,7 @@
569571
};
570572
}
571573
572-
sendMessageToHub(params.agentId, conversationId || params.conversationId, msgText, messageData).then(res => {
574+
sendMessageToHub(agentId, convId, msgText, messageData).then(res => {
573575
resolve(res);
574576
}).catch(err => {
575577
reject(err);
@@ -579,7 +581,7 @@
579581
});
580582
});
581583
} else {
582-
sendMessageToHub(params.agentId, conversationId || params.conversationId, msgText, messageData).then(res => {
584+
sendMessageToHub(agentId, convId, msgText, messageData).then(res => {
583585
resolve(res);
584586
}).catch(err => {
585587
reject(err);

0 commit comments

Comments
 (0)