gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: show user if not logged out


From: gnunet
Subject: [taler-wallet-core] branch master updated: show user if not logged out
Date: Wed, 06 Dec 2023 19:17:29 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new fa29c1494 show user if not logged out
fa29c1494 is described below

commit fa29c1494b029e195892d07dd74f4beebd78cf08
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Dec 6 15:17:23 2023 -0300

    show user if not logged out
---
 packages/demobank-ui/src/pages/LoginForm.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/packages/demobank-ui/src/pages/LoginForm.tsx 
b/packages/demobank-ui/src/pages/LoginForm.tsx
index e0ff77417..5eaad4bb0 100644
--- a/packages/demobank-ui/src/pages/LoginForm.tsx
+++ b/packages/demobank-ui/src/pages/LoginForm.tsx
@@ -31,13 +31,14 @@ import { assertUnreachable } from 
"./WithdrawalOperationPage.js";
 export function LoginForm({ currentUser, fixedUser, onRegister }: { 
fixedUser?: boolean, currentUser?: string, onRegister?: () => void }): VNode {
   const backend = useBackendState();
 
-  const [username, setUsername] = useState<string | undefined>(currentUser);
+  const sessionUser = backend.state.status !== "loggedOut" ? 
backend.state.username : undefined
+  const [username, setUsername] = useState<string | undefined>(currentUser ?? 
sessionUser);
   const [password, setPassword] = useState<string | undefined>();
   const { i18n } = useTranslationContext();
   const { api } = useBankCoreApiContext();
   const [notification, notify, handleError] = useLocalNotification()
   const {config} = useBankCoreApiContext();
-
+  
   const ref = useRef<HTMLInputElement>(null);
   useEffect(function focusInput() {
     ref.current?.focus();
@@ -160,7 +161,7 @@ export function LoginForm({ currentUser, fixedUser, 
onRegister }: { fixedUser?:
             </div>
           </div>
 
-          {currentUser ? <div class="flex justify-between">
+          {backend.state.status !== "loggedOut" ? <div class="flex 
justify-between">
             <button type="submit"
               class="rounded-md bg-white-600 px-3 py-1.5 text-sm font-semibold 
leading-6 text-black shadow-sm hover:bg-gray-100 focus-visible:outline 
focus-visible:outline-2 focus-visible:outline-offset-2 
focus-visible:outline-gray-600"
               onClick={(e) => {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]