File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/components/YandexForm Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ const YandexForm = (props: YandexFormProps) => {
115115 try {
116116 const parsed = JSON . parse ( data ) ;
117117 const height = parsed [ 'iframe-height' ] ;
118- const { message, name} = parsed ;
118+ const { message, name, redirectUrl } = parsed ;
119119 if ( name !== `form${ id } ` ) {
120120 return ;
121121 }
@@ -125,7 +125,10 @@ const YandexForm = (props: YandexFormProps) => {
125125 onLoad ?.( ) ;
126126 }
127127
128- if ( message === 'sent' ) {
128+ if ( message === 'sent' || redirectUrl ) {
129+ // event with redirectUrl is comming when form with redirect is used
130+ // otherwise, message: 'sent' is not comming on such sort of forms
131+ // to catch this event and handle analytics redirectUrl is added to condition
129132 handleSubmit ( ) ;
130133 }
131134 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments