Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove login buttons when the submission limit is reached #793

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/FormStart/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ const FormStart = () => {

const hasActiveSubmission = !!submission;
const isAuthenticated = hasActiveSubmission && submission.isAuthenticated;
// If there is no active submission, only show the login options if the submission limit has not
// been reached.
const showLoginOptions = !hasActiveSubmission && !form.submissionLimitReached;

const doStart = useStartSubmission();
const outagePluginId = useDetectAuthenticationOutage();
Expand Down Expand Up @@ -166,13 +169,15 @@ const FormStart = () => {

<FormStartMessage form={form} />

{hasActiveSubmission ? (
{hasActiveSubmission && (
<ExistingSubmissionOptions
form={form}
onDestroySession={onDestroySession}
isAuthenticated={isAuthenticated}
/>
) : (
)}

{showLoginOptions && (
<LoginOptions
// if cosign allows links in emails, we don't need to display the cosign
// login options, so strip them out
Expand Down