Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Fix follower
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbo committed Nov 8, 2024
1 parent e813d2a commit dfac685
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
7 changes: 1 addition & 6 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const {
isSearchOpen,
isModalOpen,
isWalletConnect,
isMobile,
} = storeToRefs(useAppStore())
const { addProviderEvents, removeProviderEvents } =
useBrowserExtensionProvider()
Expand Down Expand Up @@ -62,13 +61,9 @@ const setupWeb3Instances = async () => {
window.web3 = getWeb3(PROVIDERS.RPC)
}
// on mobile we need to initialize WalletConnect provider
if (isMobile.value) {
await initWalletConnectProvider()
}
// reconnect wallet connect
if (isWalletConnect.value) {
await initWalletConnectProvider()
await connectWalletConnect()
}
}
Expand Down
15 changes: 13 additions & 2 deletions composables/web3-provider/useBaseProvider.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import { INJECTED_PROVIDER } from '@/shared/provider'

const connect = async () => {
const { isWalletConnect, isMobile } = storeToRefs(useAppStore())
const { connect: connectWalletConnect } = useWalletConnectProvider()
const { isWalletConnect, isMobile, walletConnectProvider } =
storeToRefs(useAppStore())
const {
connect: connectWalletConnect,
initProvider: initWalletConnectProvider,
} = useWalletConnectProvider()
const { connect: connectBrowserExtension } = useBrowserExtensionProvider()

if (isWalletConnect.value || isMobile.value) {
await initWalletConnectProvider()
walletConnectProvider.value?.on('display_uri', (data: string) => {
const deepLink = walletConnectDeepLinkUrl(data, {
withRedirectUrl: true,
})
navigateTo(deepLink, { external: true })
})
await connectWalletConnect()
return
}
Expand Down

0 comments on commit dfac685

Please sign in to comment.