Skip to content

Commit

Permalink
Merge pull request #121 from dappforce/deploy/grill-polkadot
Browse files Browse the repository at this point in the history
Add wallet config for grill to automatically go to polkadot connect step
  • Loading branch information
teodorus-nathaniel authored Dec 15, 2023
2 parents 1015fdd + e94f7ad commit cbcf365
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/chat/ChatIframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { useChatContext } from '../providers/ChatContext'
import { isCreatorStakingPage } from '../utils'
import { useRouter } from 'next/router'
import { getCurrentWallet } from '../utils'

const creatorsHubId = '1218'

Expand Down Expand Up @@ -81,6 +82,10 @@ export default function ChatIframe ({
const config = generateGrillConfig({ spaceId, metadata })

config.onWidgetCreated = (iframe) => {
const currentWallet = getCurrentWallet()
if (currentWallet) {
iframe.src = `${iframe.src}&wallet=${currentWallet}`
}
iframe.onerror = () => {
sendEventRef.current('chat_widget_error')
}
Expand Down

0 comments on commit cbcf365

Please sign in to comment.