File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/routes/chat/[agentId]/[conversationId]/rich-content Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 2828 function collectOptions (options ) {
2929 cards = options? .filter (op => !! op .title || !! op .subtitle )? .map (op => {
3030 // @ts-ignore
31- const options = op .buttons ? .filter (x => !! x .title && !! x . payload )? .map (x => {
31+ const options = op .buttons ? .filter (x => !! x .title )? .map (x => {
3232 return {
3333 title: x .title ,
3434 payload: x .payload ,
4646
4747 buttons = options? .filter (op => !!! op .title && !!! op .subtitle )? .flatMap (op => {
4848 // @ts-ignore
49- return op .buttons ? .filter (x => !! x .title && !! x . payload )? .map (x => {
49+ return op .buttons ? .filter (x => !! x .title )? .map (x => {
5050 return {
5151 title: x .title ,
5252 payload: x .payload ,
Original file line number Diff line number Diff line change 4747
4848 /** @param {any[]} options */
4949 function collectOptions (options ) {
50- const innerOptions = options? .filter (op => !! op .title && !! op . payload ) || [];
50+ const innerOptions = options? .filter (op => !! op .title ) || [];
5151
5252 videoOptions = innerOptions? .filter (op => op .type == ElementType .Video );
5353 fileOption = innerOptions? .find (op => op .type == ElementType .File );
7878 op .isClicked = ! op .isClicked ;
7979 if (op .isClicked ) {
8080 titleAnswers = [... titleAnswers, op .title ];
81- payloadAnswers = [... payloadAnswers, op .payload ];
81+ if (!! op .payload ) {
82+ payloadAnswers = [... payloadAnswers, op .payload ];
83+ }
8284 } else {
8385 const targetIdx = titleAnswers .findIndex (a => a == op .title );
8486 titleAnswers = titleAnswers .filter ((x , index ) => index != targetIdx);
You can’t perform that action at this time.
0 commit comments