Skip to content

Commit

Permalink
Fix Type Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
BellCubeDev committed Nov 15, 2024
1 parent 8a49a79 commit 553d456
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/interface/features/getting-started-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function GettingStartedScreenInternal() {
const sx = useSx();

return <>
<H1 sx={{marginTop: 0, textAlign: 'center'}}>Welcome to Stockedhome{auth.username ? ', ' : null}{auth.username}!</H1>
<H1 sx={{marginTop: 0, textAlign: 'center'}}>Welcome to Stockedhome{auth.user ? `, ${auth.user.username}` : null}!</H1>

<View sx={{ maxWidth: ['90%', null, '9in'] }}>
<P variants={['p', 'thicker']} sx={{ textAlign: 'center', marginBottom: 6 }}> Stockedhome isn&rsquo;t much right now. Just a fancy authentication setup, really.</P>
Expand Down
6 changes: 3 additions & 3 deletions src/interface/features/login-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,17 @@ export function LogInScreenComponent({ hideLogInScreen, isLogInScreenVisible = t
const auth = useAuthentication();
const config = useConfig();

const [username, setUsername] = React.useState(auth.username);
const [username, setUsername] = React.useState(auth.user?.username);
const [error, setError] = React.useState<string | WebAuthnErrorInfo | null>(null);

React.useEffect(() => {
if (isLogInScreenVisible) {
setUsername(auth.username);
setUsername(auth.user?.username);
} else {
setUsername('');
setError(null);
}
}, [isLogInScreenVisible, auth.username]);
}, [isLogInScreenVisible, auth.user?.username]);

const hideLogInScreenRef = useUpdatedRef(hideLogInScreen);
const logIn = React.useCallback(async () => {
Expand Down

0 comments on commit 553d456

Please sign in to comment.