@@ -693,7 +693,7 @@ interface SurveyPopupProps {
693
693
isPopup ?: boolean
694
694
onPreviewSubmit ?: ( res : string | string [ ] | number | null ) => void
695
695
onPopupSurveyDismissed ?: ( ) => void
696
- onPopupSurveySent ?: ( ) => void
696
+ onCloseConfirmationMessage ?: ( ) => void
697
697
}
698
698
699
699
export function SurveyPopup ( {
@@ -706,7 +706,7 @@ export function SurveyPopup({
706
706
isPopup,
707
707
onPreviewSubmit = ( ) => { } ,
708
708
onPopupSurveyDismissed = ( ) => { } ,
709
- onPopupSurveySent = ( ) => { } ,
709
+ onCloseConfirmationMessage = ( ) => { } ,
710
710
} : SurveyPopupProps ) {
711
711
const isPreviewMode = Number . isInteger ( previewPageIndex )
712
712
// NB: The client-side code passes the millisecondDelay in seconds, but setTimeout expects milliseconds, so we multiply by 1000
@@ -741,9 +741,6 @@ export function SurveyPopup({
741
741
} ,
742
742
isPopup : isPopup || false ,
743
743
onPreviewSubmit,
744
- onPopupSurveySent : ( ) => {
745
- onPopupSurveySent ( )
746
- } ,
747
744
} }
748
745
>
749
746
{ ! shouldShowConfirmation ? (
@@ -761,7 +758,10 @@ export function SurveyPopup({
761
758
contentType = { survey . appearance ?. thankYouMessageDescriptionContentType }
762
759
appearance = { survey . appearance || defaultSurveyAppearance }
763
760
styleOverrides = { { ...style , ...confirmationBoxLeftStyle } }
764
- onClose = { ( ) => setIsPopupVisible ( false ) }
761
+ onClose = { ( ) => {
762
+ setIsPopupVisible ( false )
763
+ onCloseConfirmationMessage ( )
764
+ } }
765
765
/>
766
766
) }
767
767
</ SurveyContext . Provider >
@@ -783,8 +783,7 @@ export function Questions({
783
783
survey . appearance ?. backgroundColor || defaultSurveyAppearance . backgroundColor
784
784
)
785
785
const [ questionsResponses , setQuestionsResponses ] = useState ( { } )
786
- const { previewPageIndex, onPopupSurveyDismissed, isPopup, onPreviewSubmit, onPopupSurveySent } =
787
- useContext ( SurveyContext )
786
+ const { previewPageIndex, onPopupSurveyDismissed, isPopup, onPreviewSubmit } = useContext ( SurveyContext )
788
787
const [ currentQuestionIndex , setCurrentQuestionIndex ] = useState ( previewPageIndex || 0 )
789
788
const surveyQuestions = useMemo ( ( ) => getDisplayOrderQuestions ( survey ) , [ survey ] )
790
789
@@ -819,7 +818,6 @@ export function Questions({
819
818
const nextStep = getNextSurveyStep ( survey , displayQuestionIndex , res )
820
819
if ( nextStep === SurveyQuestionBranchingType . End ) {
821
820
sendSurveyEvent ( { ...questionsResponses , [ responseKey ] : res } , survey , posthog )
822
- onPopupSurveySent ( )
823
821
} else {
824
822
setCurrentQuestionIndex ( nextStep )
825
823
}
@@ -1036,7 +1034,7 @@ export function FeedbackWidget({
1036
1034
removeSurveyFromFocus = { removeSurveyFromFocus }
1037
1035
isPopup = { true }
1038
1036
onPopupSurveyDismissed = { resetShowSurvey }
1039
- onPopupSurveySent = { resetShowSurvey }
1037
+ onCloseConfirmationMessage = { resetShowSurvey }
1040
1038
/>
1041
1039
) }
1042
1040
</ Preact . Fragment >
0 commit comments