File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed
src/routes/chat/[agentId]/[conversationId]/chatImage Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change 3030
3131 /** @param {any[]} options */
3232 function collectOptions (options ) {
33- cancelOption = options? .find (op => op .title ? .toLowerCase () === ' no' );
34- confirmOption = {
35- title: ' Yes, I have uploaded attachments.' ,
36- payload: ' I have uploaded attachments.'
37- };
33+ confirmOption = options? .find (op => op .title ? .toLowerCase ()? .startsWith (" yes" ));
34+ cancelOption = options? .find (op => op .title ? .toLowerCase ()? .startsWith (" no" ));
35+
36+ if (! confirmOption) {
37+ confirmOption = {
38+ title: ' Yes, I have uploaded attachments.' ,
39+ payload: ' I have uploaded attachments.'
40+ };
41+ }
42+
43+ if (! cancelOption) {
44+ cancelOption = {
45+ title: ' No, I do not have attachments to upload.' ,
46+ payload: ' No, I do not have attachments to upload.'
47+ };
48+ }
3849 }
3950
4051 /**
8293< / div>
8394
8495< div class = " plain-option-container" >
85- {#if files? .length > 0 }
96+ {#if files? .length > 0 && confirmOption }
8697 < button
8798 class = {` btn btn-sm m-1 ${ confirmOption? .is_secondary ? ' btn-outline-secondary' : ' btn-outline-primary' }` }
8899 disabled={disabled}
89100 on:click={(e) => handleClickOption(e, confirmOption)}
90101 >
91102 {confirmOption?.title}
92103 </button>
93- {:else}
104+ {/if}
105+ {#if files?.length <= 0 && cancelOption}
94106 <button
95107 class={` btn btn- sm m- 1 ${cancelOption? .is_secondary ? ' btn-outline-secondary' : ' btn-outline-primary' }` }
96108 disabled={disabled}
You can’t perform that action at this time.
0 commit comments