From 4e1fe5eb10a5db44c86becbcef66daacc408239d Mon Sep 17 00:00:00 2001
From: Florian Dold <florian@dold.me>
Date: Wed, 13 Apr 2022 21:40:56 +0200
Subject: anastasis-webui: updated challenge feedback

---
 .../src/pages/home/authMethod/AuthMethodPostSolve.tsx            | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

(limited to 'packages/anastasis-webui/src/pages/home/authMethod/AuthMethodPostSolve.tsx')

diff --git a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodPostSolve.tsx b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodPostSolve.tsx
index fcff0b498..382ffa00a 100644
--- a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodPostSolve.tsx
+++ b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodPostSolve.tsx
@@ -9,6 +9,7 @@ import { TextInput } from "../../../components/fields/TextInput";
 import { useAnastasisContext } from "../../../context/anastasis";
 import { AnastasisClientFrame } from "../index";
 import { SolveOverviewFeedbackDisplay } from "../SolveScreen";
+import { shouldHideConfirm } from "./helpers";
 import { AuthMethodSolveProps } from "./index";
 
 export function AuthMethodPostSolve({ id }: AuthMethodSolveProps): VNode {
@@ -102,12 +103,6 @@ export function AuthMethodPostSolve({ id }: AuthMethodSolveProps): VNode {
     reducer?.back();
   }
 
-  const shouldHideConfirm =
-    feedback?.state === ChallengeFeedbackStatus.RateLimitExceeded ||
-    feedback?.state === ChallengeFeedbackStatus.Redirect ||
-    feedback?.state === ChallengeFeedbackStatus.Unsupported ||
-    feedback?.state === ChallengeFeedbackStatus.TruthUnknown;
-
   return (
     <AnastasisClientFrame hideNav title="Postal Challenge">
       <SolveOverviewFeedbackDisplay feedback={feedback} />
@@ -130,7 +125,7 @@ export function AuthMethodPostSolve({ id }: AuthMethodSolveProps): VNode {
         <button class="button" onClick={onCancel}>
           Cancel
         </button>
-        {!shouldHideConfirm && (
+        {!shouldHideConfirm(feedback) && (
           <AsyncButton class="button is-info" onClick={onNext}>
             Confirm
           </AsyncButton>
-- 
cgit v1.2.3

