diff --git a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx
index b8ae1c7c..9664e7fb 100644
--- a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx
+++ b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx
@@ -118,31 +118,33 @@ export default function OfferAnalysis({
];
return (
- analysis && (
-
- {isError && (
-
- An error occurred while generating profile analysis.
-
- )}
- {isLoading &&
}
- {!isError && !isLoading && (
-
-
-
-
-
- )}
-
- )
+ <>
+ {isLoading && }
+ {analysis && (
+
+ {isError && (
+
+ An error occurred while generating profile analysis.
+
+ )}
+ {!isError && !isLoading && (
+
+
+
+
+
+ )}
+
+ )}
+ >
);
}
diff --git a/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx b/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx
index 4de2911d..02c9ed29 100644
--- a/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx
+++ b/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx
@@ -110,7 +110,11 @@ export default function OffersSubmissionForm({
defaultValues: initialOfferProfileValues,
mode: 'all',
});
- const { handleSubmit, trigger } = formMethods;
+ const {
+ handleSubmit,
+ trigger,
+ formState: { isSubmitting, isSubmitSuccessful },
+ } = formMethods;
const generateAnalysisMutation = trpc.useMutation(
['offers.analysis.generate'],
@@ -178,7 +182,7 @@ export default function OffersSubmissionForm({
const onSubmit: SubmitHandler = async (data) => {
const result = await trigger();
- if (!result) {
+ if (!result || isSubmitting || isSubmitSuccessful) {
return;
}
@@ -286,7 +290,13 @@ export default function OffersSubmissionForm({
variant="secondary"
onClick={() => setStep(step - 1)}
/>
- {' '}
+
)}