From 3a95325d4579a4a73127e9032e957588468b82f1 Mon Sep 17 00:00:00 2001 From: Alex Cottner <148472676+alexcottner@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:32:40 -0600 Subject: [PATCH] Adjusting authForm spinner to use session.busy (#3218) --- src/components/AuthForm.tsx | 5 +---- src/sagas/session.ts | 1 + test/components/AuthForm_test.tsx | 2 -- test/sagas/session_test.ts | 11 +++++++++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/AuthForm.tsx b/src/components/AuthForm.tsx index 5ace009e5..f97ccfdad 100644 --- a/src/components/AuthForm.tsx +++ b/src/components/AuthForm.tsx @@ -291,7 +291,6 @@ export default function AuthForm({ const { schema: currentSchema, uiSchema: curentUiSchema } = authSchemas(authType); - const [showSpinner, setshowSpinner] = useState(false); const [schema, setSchema] = useState(currentSchema); const [uiSchema, setUiSchema] = useState(curentUiSchema); const [formData, setFormData] = useState({ @@ -305,7 +304,6 @@ export default function AuthForm({ const serverInfoCallback = async auth => { await getServerInfo(auth); - setshowSpinner(false); }; const authMethods = getSupportedAuthMethods(session); @@ -322,7 +320,6 @@ export default function AuthForm({ const onChange = ({ formData: updatedData }: RJSFSchema) => { if (formData.server !== updatedData.server) { - setshowSpinner(true); const newServer = servers.find(x => x.server === updatedData.server); updatedData.authType = newServer?.authType || ANONYMOUS_AUTH; } @@ -382,7 +379,7 @@ export default function AuthForm({ formData={formData} onChange={onChange} onSubmit={onSubmit} - showSpinner={showSpinner} + showSpinner={session.busy} >