Skip to content

Commit

Permalink
fix: update grill if address changes
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Dec 15, 2023
1 parent 8727de9 commit 955fcb1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/chat/ChatIframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useChatContext } from '../providers/ChatContext'
import { isCreatorStakingPage } from '../utils'
import { useRouter } from 'next/router'
import { getCurrentWallet } from '../utils'
import { useMyAddress } from '../providers/MyExtensionAccountsContext'

const creatorsHubId = '1218'

Expand Down Expand Up @@ -72,6 +73,7 @@ export default function ChatIframe ({
onUnreadCountChange,
...props
}: ChatIframeProps) {
const myAddress = useMyAddress()
const sendEvent = useSendEvent()
const sendEventRef = useWrapInRef(sendEvent)
const { spaceId, metadata } = useChatContext()
Expand Down Expand Up @@ -121,7 +123,8 @@ export default function ChatIframe ({
return () => {
if (listener) grill.removeMessageListener(eventListener)
}
}, [ spaceId, pathname ])
// reload grill widget when user changes to update the wallet data
}, [ spaceId, pathname, myAddress ])

return (
<div
Expand Down

0 comments on commit 955fcb1

Please sign in to comment.