Skip to content

Commit

Permalink
should be good to go
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTranqui committed Apr 19, 2024
1 parent f8a4117 commit 026cd76
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps/site/components/client/ChannelDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { useForm } from 'react-hook-form'
import { toast } from 'sonner'
import type { Hex } from 'viem'
import { usePrivy } from '@privy-io/react-auth'
import { useSelectedLayoutSegments } from 'next/navigation'
import { usePathname } from 'next/navigation'

interface ChannelDialogProps {
trigger: React.ReactNode
Expand All @@ -44,10 +44,16 @@ interface ChannelDialogProps {

export function ChannelDialog({ trigger, hideTrigger }: ChannelDialogProps) {
const router = useRouter()
const pathname = usePathname()
const [dialogOpen, setDialogOpen] = React.useState(false)
const [isSubmitting, setIsSubmitting] = React.useState(false)

const { signMessage, userId: targetUserId, embeddedWallet } = useUserContext()
const {
signMessage,
userId: targetUserId,
username,
embeddedWallet,
} = useUserContext()
const { authenticated, login } = usePrivy()

const form = useForm<NewChannelSchemaValues>({
Expand Down Expand Up @@ -99,7 +105,7 @@ export function ChannelDialog({ trigger, hideTrigger }: ChannelDialogProps) {

return (
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
{!authenticated ? (
{!authenticated || !username || `/${username}` !== pathname ? (
<Button
className={hideTrigger ? 'hidden' : ''}
variant="link"
Expand Down

0 comments on commit 026cd76

Please sign in to comment.