@@ -2,7 +2,6 @@ import { hooks } from 'botframework-webchat-api';
22import { getOrgSchemaMessage , OrgSchemaAction , parseAction , WebChatActivity } from 'botframework-webchat-core' ;
33import classNames from 'classnames' ;
44import React , { memo , useCallback , useMemo , useState } from 'react' ;
5- import { useRefFrom } from 'use-ref-from' ;
65
76import useStyleSet from '../hooks/useStyleSet' ;
87import dereferenceBlankNodes from '../Utils/JSONLinkedData/dereferenceBlankNodes' ;
@@ -49,7 +48,6 @@ function ActivityFeedback({ activity }: ActivityFeedbackProps) {
4948
5049 const [ selectedAction , setSelectedAction ] = useState < OrgSchemaAction | undefined > ( ) ;
5150 const [ feedbackSubmitted , setFeedbackSubmitted ] = useState < boolean > ( false ) ;
52- const selectedActionRef = useRefFrom ( selectedAction ) ;
5351
5452 const isFeedbackLoopSupported = hasFeedbackLoop ( activity ) ;
5553
@@ -68,7 +66,7 @@ function ActivityFeedback({ activity }: ActivityFeedbackProps) {
6866 . map ( action => ( {
6967 ...action ,
7068 actionStatus :
71- action [ '@type' ] === selectedActionRef . current ?. [ '@type' ] && feedbackSubmitted
69+ action [ '@type' ] === selectedAction ?. [ '@type' ] && feedbackSubmitted
7270 ? 'CompletedActionStatus'
7371 : action . actionStatus
7472 } ) ) ;
@@ -86,7 +84,7 @@ function ActivityFeedback({ activity }: ActivityFeedbackProps) {
8684 // Intentionally left blank.
8785 }
8886 return Object . freeze ( new Set ( [ ] as OrgSchemaAction [ ] ) ) ;
89- } , [ feedbackSubmitted , graph , messageThing , selectedActionRef ] ) ;
87+ } , [ feedbackSubmitted , graph , messageThing , selectedAction ] ) ;
9088
9189 const handleFeedbackActionClick = useCallback (
9290 ( action : OrgSchemaAction ) => setSelectedAction ( action === selectedAction ? undefined : action ) ,
0 commit comments