Skip to content

Commit 8fa60f8

Browse files
committed
Bugfix when uploading a file from on the widget
1 parent 96aff39 commit 8fa60f8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

widget/components/chat/msgs/pieces/FileUploadMsgPiece.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<script setup>
2424
import { useGlobalStore } from "~/store";
2525
import { ref, computed } from "vue";
26-
import { createTextMessage } from "~/utils";
26+
import { createMessage } from "~/utils";
2727
2828
import FileAttachment from "~/components/icons/FileAttachment.vue";
2929
@@ -105,11 +105,14 @@ async function uploadFileToS3(file) {
105105
}
106106
107107
function handleFileUploaded(s3_path, file_name) {
108-
const m = createTextMessage("human", {
108+
const m = createMessage("human", [{
109+
"type": "file_uploaded",
110+
"payload": {
109111
"s3_path": s3_path,
110112
"name": file_name,
111113
// We don't pass url because we don't have it yet
112-
}, "0", "0");
114+
},
115+
}], "0", "0");
113116
if (store.userId !== undefined)
114117
m["sender"]["id"] = store.userId
115118

0 commit comments

Comments
 (0)