Skip to content

Commit f17106e

Browse files
committed
Use instance variable for _didSubmitForm
1 parent e63ee11 commit f17106e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/core/src/js/feedback/FeedbackWidget.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
3333
...defaultConfiguration
3434
}
3535

36-
private static _didSubmitForm: boolean = false;
36+
private _didSubmitForm: boolean = false;
3737
private static _savedState: Omit<FeedbackWidgetState, 'isVisible'> = {
3838
name: '',
3939
email: '',
@@ -106,7 +106,7 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
106106
onSubmitSuccess({ name: trimmedName, email: trimmedEmail, message: trimmedDescription, attachments: attachments });
107107
Alert.alert(text.successMessageText);
108108
onFormSubmitted();
109-
FeedbackWidget._didSubmitForm = true;
109+
this._didSubmitForm = true;
110110
} catch (error) {
111111
const errorString = `Feedback form submission failed: ${error}`;
112112
onSubmitError(new Error(errorString));
@@ -168,9 +168,9 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
168168
* Save the state before unmounting the component.
169169
*/
170170
public componentWillUnmount(): void {
171-
if (FeedbackWidget._didSubmitForm) {
171+
if (this._didSubmitForm) {
172172
this._clearFormState();
173-
FeedbackWidget._didSubmitForm = false;
173+
this._didSubmitForm = false;
174174
} else {
175175
this._saveFormState();
176176
}

0 commit comments

Comments
 (0)