@@ -379,6 +379,7 @@ type AddAttachmentWithCommentParams = {
379379 timezone ?: Timezone ;
380380 shouldPlaySound ?: boolean ;
381381 isInSidePanel ?: boolean ;
382+ sidePanelContext ?: SidePanelContext ;
382383} ;
383384
384385const addNewMessageWithText = new Set < string > ( [ WRITE_COMMANDS . ADD_COMMENT , WRITE_COMMANDS . ADD_TEXT_AND_ATTACHMENT ] ) ;
@@ -807,7 +808,7 @@ function addActions({
807808 }
808809 }
809810
810- if ( isInSidePanel && isConciergeChat && sidePanelContext ) {
811+ if ( isInSidePanel && isConciergeChat && sidePanelContext && commandName === WRITE_COMMANDS . ADD_COMMENT ) {
811812 parameters . sidePanelContext = JSON . stringify ( sidePanelContext ) ;
812813 }
813814
@@ -936,6 +937,7 @@ function addAttachmentWithComment({
936937 timezone = CONST . DEFAULT_TIME_ZONE ,
937938 shouldPlaySound = false ,
938939 isInSidePanel = false ,
940+ sidePanelContext,
939941} : AddAttachmentWithCommentParams ) {
940942 if ( ! report ?. reportID ) {
941943 return ;
@@ -950,17 +952,17 @@ function addAttachmentWithComment({
950952
951953 // Single attachment
952954 if ( ! Array . isArray ( attachments ) ) {
953- addActions ( { report, notifyReportID, ancestors, timezoneParam : timezone , currentUserAccountID, text, file : attachments , isInSidePanel} ) ;
955+ addActions ( { report, notifyReportID, ancestors, timezoneParam : timezone , currentUserAccountID, text, file : attachments , isInSidePanel, sidePanelContext } ) ;
954956 handlePlaySound ( ) ;
955957 return ;
956958 }
957959
958960 // Multiple attachments - first: combine text + first attachment as a single action
959- addActions ( { report, notifyReportID, ancestors, timezoneParam : timezone , currentUserAccountID, text, file : attachments ?. at ( 0 ) , isInSidePanel} ) ;
961+ addActions ( { report, notifyReportID, ancestors, timezoneParam : timezone , currentUserAccountID, text, file : attachments ?. at ( 0 ) , isInSidePanel, sidePanelContext } ) ;
960962
961963 // Remaining: attachment-only actions (no text duplication)
962964 for ( let i = 1 ; i < attachments ?. length ; i += 1 ) {
963- addActions ( { report, notifyReportID, ancestors, timezoneParam : timezone , currentUserAccountID, text : '' , file : attachments ?. at ( i ) , isInSidePanel} ) ;
965+ addActions ( { report, notifyReportID, ancestors, timezoneParam : timezone , currentUserAccountID, text : '' , file : attachments ?. at ( i ) , isInSidePanel, sidePanelContext } ) ;
964966 }
965967
966968 // Play sound once
0 commit comments