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 @@ -102,7 +102,7 @@ const YandexForm = (props: YandexFormProps) => {
102102 try {
103103 const parsed = JSON . parse ( data ) ;
104104 const height = parsed [ 'iframe-height' ] ;
105- const { message, name} = parsed ;
105+ const { message, name, redirectUrl } = parsed ;
106106 if ( name !== `form${ id } ` ) {
107107 return ;
108108 }
@@ -112,7 +112,10 @@ const YandexForm = (props: YandexFormProps) => {
112112 onLoad ?.( ) ;
113113 }
114114
115- if ( message === 'sent' ) {
115+ if ( message === 'sent' || redirectUrl ) {
116+ // event with redirectUrl is comming when form with redirect is used
117+ // otherwise, message: 'sent' is not comming on such sort of forms
118+ // to catch this event and handle analytics redirectUrl is added to condition
116119 handleSubmit ( ) ;
117120 }
118121 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments