@@ -33,7 +33,6 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
33
33
...defaultConfiguration
34
34
}
35
35
36
- private static _didSubmitForm : boolean = false ;
37
36
private static _savedState : Omit < FeedbackWidgetState , 'isVisible' > = {
38
37
name : '' ,
39
38
email : '' ,
@@ -43,6 +42,8 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
43
42
attachmentUri : undefined ,
44
43
} ;
45
44
45
+ private _didSubmitForm : boolean = false ;
46
+
46
47
public constructor ( props : FeedbackWidgetProps ) {
47
48
super ( props ) ;
48
49
@@ -108,7 +109,7 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
108
109
onSubmitSuccess ( { name : trimmedName , email : trimmedEmail , message : trimmedDescription , attachments : attachments } ) ;
109
110
Alert . alert ( text . successMessageText ) ;
110
111
onFormSubmitted ( ) ;
111
- FeedbackWidget . _didSubmitForm = true ;
112
+ this . _didSubmitForm = true ;
112
113
} catch ( error ) {
113
114
const errorString = `Feedback form submission failed: ${ error } ` ;
114
115
onSubmitError ( new Error ( errorString ) ) ;
@@ -179,9 +180,9 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
179
180
* Save the state before unmounting the component.
180
181
*/
181
182
public componentWillUnmount ( ) : void {
182
- if ( FeedbackWidget . _didSubmitForm ) {
183
+ if ( this . _didSubmitForm ) {
183
184
this . _clearFormState ( ) ;
184
- FeedbackWidget . _didSubmitForm = false ;
185
+ this . _didSubmitForm = false ;
185
186
} else {
186
187
this . _saveFormState ( ) ;
187
188
}
0 commit comments