File tree Expand file tree Collapse file tree 4 files changed +31
-7
lines changed
chat/[agentId]/[conversationId]
page/conversation/[conversationId] Expand file tree Collapse file tree 4 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 44 import { getUserStore } from ' $lib/helpers/store' ;
55 import { getConversationFiles } from ' $lib/services/conversation-service' ;
66 import { PUBLIC_SERVICE_URL } from ' $env/static/public' ;
7- import { page } from ' $app/stores' ;
87
9- /** @type {any} */
10- export let message;
8+ /** @type {string} */
9+ export let conversationId;
10+
11+ /** @type {string} */
12+ export let messageId;
13+
14+ /** @type {string} */
15+ export let galleryClasses = ' ' ;
16+
17+ /** @type {string} */
18+ export let galleryStyles = ' ' ;
1119
1220 /** @type {any[]} */
1321 let files = [];
1725 onMount (() => {
1826 const user = getUserStore ();
1927 token = user .token ;
20- getConversationFiles ($page . params . conversationId , message ? . message_id ).then (data => {
28+ getConversationFiles (conversationId, messageId ).then (data => {
2129 // @ts-ignore
2230 files = data? .filter (item => !! item .file_url )? .map (item => {
2331 return {
3139
3240< div>
3341 < FileGallery
34- containerStyles= {' justify-content: flex-end;' }
42+ containerClasses= {galleryClasses}
43+ containerStyles= {galleryStyles}
3544 files= {files}
3645 / >
3746< / div>
Original file line number Diff line number Diff line change @@ -82,4 +82,11 @@ $file-screen-max-width: 500px;
8282 flex-wrap : wrap ;
8383 gap : 3px ;
8484 justify-content : flex-start ;
85+ }
86+
87+ .dialog-file-display {
88+ .gallery-item {
89+ width : $attachment-width-lite ;
90+ height : $attachment-height-lite ;
91+ }
8592}
Original file line number Diff line number Diff line change 2727 import { EditorType , SenderAction , UserRole } from ' $lib/helpers/enums' ;
2828 import RichContent from ' ./richContent/rich-content.svelte' ;
2929 import RcDisclaimer from ' ./richContent/rc-disclaimer.svelte' ;
30- import MessageImageGallery from ' ./chatImage/message-image-gallery .svelte' ;
30+ import MessageImageGallery from ' $lib/common/MessageImageGallery .svelte' ;
3131 import ChatImageUploader from ' ./chatImage/chat-image-uploader.svelte' ;
3232 import ChatImageGallery from ' ./chatImage/chat-image-gallery.svelte' ;
3333 import ContentLog from ' ./contentLogs/content-log.svelte' ;
941941 < RcDisclaimer content= {message .post_action_disclaimer } / >
942942 {/ if }
943943 {#if message .is_load_images }
944- < MessageImageGallery message = { message} / >
944+ < MessageImageGallery conversationId = { params . conversationId } messageId = { message . message_id } / >
945945 {/ if }
946946 < / div>
947947 {#if ! isLite}
Original file line number Diff line number Diff line change 77 import { _ } from ' svelte-i18n'
88 import { USER_SENDERS } from ' $lib/helpers/constants' ;
99 import Markdown from ' $lib/common/Markdown.svelte' ;
10+ import MessageImageGallery from ' $lib/common/MessageImageGallery.svelte' ;
1011
1112 /** @type {import('$types').ChatResponseModel[]} */
1213 let dialogs = [];
6768 < p class = " fw-bold" >
6869 < Markdown text= {dialog? .rich_content ? .message ? .text || dialog? .text } / >
6970 < / p>
71+ {#if USER_SENDERS .includes (dialog? .sender ? .role || ' ' )}
72+ < MessageImageGallery
73+ galleryClasses= {' dialog-file-display' }
74+ conversationId= {conversation .id }
75+ messageId= {dialog .message_id }
76+ / >
77+ {/ if }
7078 < / div>
7179 {#if dialog .message_id }
7280 < div>
You can’t perform that action at this time.
0 commit comments