File tree Expand file tree Collapse file tree 2 files changed +26
-28
lines changed
routes/chat/[agentId]/[conversationId] Expand file tree Collapse file tree 2 files changed +26
-28
lines changed Original file line number Diff line number Diff line change 2828 }
2929 </script >
3030
31- <div class =" fixed-bottom float-bottom-right" >
32- {#if $chatBotStore .showChatBox }
33- <div transition:fade ={{ delay : 250 , duration : 300 }}>
34- <iframe
35- src ={chatUrl }
36- width =" 380px"
37- height =" 650px"
38- class ={` border border-2 rounded-3 m-3 float-end chat-iframe ` }
39- title =" live chat"
40- id ={CHAT_FRAME_ID }
41- />
42- </div >
43- {/if }
31+ <div class =" chatbot-container fixed-bottom float-bottom-right" >
32+ <iframe
33+ src ={chatUrl }
34+ width ={` ${$chatBotStore .showChatBox ? ' 380px' : ' 0px' } ` }
35+ height ={` ${$chatBotStore .showChatBox ? ' 650px' : ' 0px' } ` }
36+ class ={` border border-2 rounded-3 m-3 float-end ${$chatBotStore .showChatBox ? ' chat-iframe' : ' ' } ` }
37+ title =" live chat"
38+ id ={CHAT_FRAME_ID }
39+ />
4440
4541 {#if ! $chatBotStore .showChatBox }
46- <div class ="mb-3 float-end wave-effect" transition:fade ={{ delay : 100 , duration : 500 }}>
42+ <div
43+ class =" chatbot-icon mb-3 float-end wave-effect"
44+ transition:fade ={{ delay : 50 , duration : 200 }}
45+ >
4746 <button class ="btn btn-transparent" on:click ={() => openChatBox ()}>
4847 <img alt ="live chat" class ="avatar-md rounded-circle" src ={PUBLIC_LIVECHAT_ENTRY_ICON } />
49- <iframe
50- src ={chatUrl }
51- width =" 0px"
52- height =" 0px"
53- title =" live chat"
54- id ={CHAT_FRAME_ID }
55- />
5648 </button >
5749 </div >
5850 {/if }
8981 margin-right : 0px ;
9082 margin-left : auto ;
9183 }
84+
85+ .chatbot-container {
86+ display : flex ;
87+ flex-direction : column ;
88+ }
89+
90+ .chatbot-icon {
91+ display : flex ;
92+ justify-content : flex-end ;
93+ }
9294 </style >
Original file line number Diff line number Diff line change 221221 isCreatingNewConv = false ;
222222 if (conv && !! e .data .text ) {
223223 isLoading = true ;
224+ openFrame ();
224225 sendChatMessage (e .data .text , e .data .data || null , conv .id ).then (() => {
225226 isLoading = false ;
226- openFrame ();
227227 redirectToNewConversation (conv);
228228 }).catch (() => {
229229 isLoading = false ;
230- openFrame ();
231230 });
232231 } else {
233232 openFrame ();
241240 /** @param {any} e */
242241 function handleChatAction (e ) {
243242 if (!! e .data .text && ! isThinking && ! isSendingMsg) {
244- sendChatMessage (e .data .text , e .data .data || null ).then (() => {
245- openFrame ();
246- }).catch (() => {
247- openFrame ();
248- });
243+ openFrame ();
244+ sendChatMessage (e .data .text , e .data .data || null );
249245 }
250246 }
251247
You can’t perform that action at this time.
0 commit comments