Skip to content

Commit

Permalink
fix: Workspace - Submit button loads infinitely and is not deactivate…
Browse files Browse the repository at this point in the history
…d while offline.

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
  • Loading branch information
Krishna2323 committed Aug 21, 2024
1 parent 42e8486 commit 1b77c25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/FeedbackSurvey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ type FeedbackSurveyProps = {

/** Indicates whether a loading indicator should be shown */
isLoading?: boolean;

/** Should the submit button be enabled when offline */
enabledWhenOffline?: boolean;
};

function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerText, isNoteRequired, isLoading, formID}: FeedbackSurveyProps) {
function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerText, isNoteRequired, isLoading, formID, enabledWhenOffline = true}: FeedbackSurveyProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const [draft, draftResults] = useOnyx(`${formID}Draft`);
Expand Down Expand Up @@ -103,7 +106,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles, footerTe
onSubmit={handleSubmit}
submitButtonText={translate('common.submit')}
isSubmitButtonVisible={false}
enabledWhenOffline
enabledWhenOffline={enabledWhenOffline}
>
<View style={styles.mh5}>
<Text style={styles.textHeadline}>{title}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function RequestEarlyCancellationPage() {
footerText={<Text style={[styles.mb2, styles.mt4]}>{acknowledgementText}</Text>}
isNoteRequired
isLoading={isLoading}
enabledWhenOffline={false}
/>
),
[acknowledgementText, isLoading, styles.flex1, styles.mb2, styles.mt4, translate],
Expand Down

0 comments on commit 1b77c25

Please sign in to comment.