@@ -33,7 +33,6 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
3333 ...defaultConfiguration
3434 }
3535
36- private static _didSubmitForm : boolean = false ;
3736 private static _savedState : Omit < FeedbackWidgetState , 'isVisible' > = {
3837 name : '' ,
3938 email : '' ,
@@ -43,6 +42,8 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
4342 attachmentUri : undefined ,
4443 } ;
4544
45+ private _didSubmitForm : boolean = false ;
46+
4647 public constructor ( props : FeedbackWidgetProps ) {
4748 super ( props ) ;
4849
@@ -108,7 +109,7 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
108109 onSubmitSuccess ( { name : trimmedName , email : trimmedEmail , message : trimmedDescription , attachments : attachments } ) ;
109110 Alert . alert ( text . successMessageText ) ;
110111 onFormSubmitted ( ) ;
111- FeedbackWidget . _didSubmitForm = true ;
112+ this . _didSubmitForm = true ;
112113 } catch ( error ) {
113114 const errorString = `Feedback form submission failed: ${ error } ` ;
114115 onSubmitError ( new Error ( errorString ) ) ;
@@ -179,9 +180,9 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
179180 * Save the state before unmounting the component.
180181 */
181182 public componentWillUnmount ( ) : void {
182- if ( FeedbackWidget . _didSubmitForm ) {
183+ if ( this . _didSubmitForm ) {
183184 this . _clearFormState ( ) ;
184- FeedbackWidget . _didSubmitForm = false ;
185+ this . _didSubmitForm = false ;
185186 } else {
186187 this . _saveFormState ( ) ;
187188 }
0 commit comments