Skip to content

Commit

Permalink
user button loading spinner fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cdleveille committed Jun 9, 2024
1 parent 6f81106 commit a6f7075
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ h1 {
position: absolute;
top: 0.25rem;
left: 0.25rem;
z-index: 1000;
}

.settings-btn {
Expand Down
5 changes: 4 additions & 1 deletion src/components/user/UserButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export const UserButton = () => {
const [isLoading, setIsLoading] = useState(true);
const { showSignInModal } = useAppContext();

useEffect(() => setIsLoading(false), []);
useEffect(() => {
const timeout = setTimeout(() => setIsLoading(false), 1000);
return () => clearTimeout(timeout);
}, []);

return (
<div className="user-btn">
Expand Down

0 comments on commit a6f7075

Please sign in to comment.