Skip to content

Commit

Permalink
feat: verify login
Browse files Browse the repository at this point in the history
  • Loading branch information
friendlysxw committed Feb 8, 2024
1 parent b956474 commit 637eab7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions apps/u3/src/container/community/CommunityLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import useLoadCommunityMembers from '@/hooks/community/useLoadCommunityMembers';
import useLoadCommunityTopMembers from '@/hooks/community/useLoadCommunityTopMembers';
import { CommunityInfo } from '@/services/community/types/community';
import { fetchCommunity } from '@/services/community/api/community';
import useLogin from '@/hooks/shared/useLogin';

export default function CommunityLayout() {
const { isLogin, login } = useLogin();
const { channelId } = useParams();

const [communityLoading, setCommunityLoading] = useState(true);
Expand Down Expand Up @@ -42,6 +44,9 @@ export default function CommunityLayout() {
setDefaultPostChannelId,
userChannels,
joinChannel,
currFid,
openFarcasterQR,
isConnected: isLoginFarcaster,
} = useFarcasterCtx();

useEffect(() => {
Expand Down Expand Up @@ -108,6 +113,14 @@ export default function CommunityLayout() {
<GuestModeHeader
joining={joining}
joinAction={async () => {
if (!isLogin) {
login();
return;
}
if (!isLoginFarcaster) {
openFarcasterQR();
return;
}
setJoining(true);
await joinChannel(parentUrl);
await new Promise((resolve) => {
Expand Down

0 comments on commit 637eab7

Please sign in to comment.