Skip to content

Commit

Permalink
fix: update login handling in Auth and CommunityProfile components
Browse files Browse the repository at this point in the history
- Changed the parameter destructuring in the onComplete callback of useLogin in the Auth component for improved clarity.
- Removed the useLogin hook from the CommunityProfile component, simplifying the component and enhancing separation of concerns.
  • Loading branch information
tinypell3ts committed Jan 15, 2025
1 parent b596d93 commit f1b9220
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/auth/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function Auth() {
const router = useRouter();

useLogin({
onComplete: async (user, isNewUser) => {
onComplete: async ({ user, isNewUser }) => {
if (isNewUser && user.wallet?.address) {
await fundAccount();
}
Expand Down
11 changes: 1 addition & 10 deletions src/components/community-profile.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
"use client";

import { fundAccount } from "@/lib/openformat";
import { useLogin, usePrivy } from "@privy-io/react-auth";
import type { Address } from "viem";
import { usePrivy } from "@privy-io/react-auth";
import LinkAccounts from "./link-accounts";
import Profile from "./profile-header";

export default function CommunityProfile() {
const { logout } = usePrivy();
useLogin({
onComplete: async (user, isNewUser) => {
if (isNewUser && user.wallet?.address) {
await fundAccount(user.wallet.address as Address);
}
},
});

return (
<div className="flex flex-col-reverse items-center gap-4 md:flex-row md:items-center md:justify-between">
Expand Down

0 comments on commit f1b9220

Please sign in to comment.