Skip to content

Commit

Permalink
Merge pull request #4852 from thematters/feat/injected-wallet
Browse files Browse the repository at this point in the history
feat(auth): use injected connector instead of metamask connector
  • Loading branch information
gitwoz authored Oct 14, 2024
2 parents 40213e3 + e3e7b29 commit 3d1fd0c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/common/utils/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
polygon,
polygonMumbai,
} from 'wagmi/chains'
import { MetaMaskConnector } from 'wagmi/connectors/metaMask'
import { InjectedConnector } from 'wagmi/connectors/injected'
import { WalletConnectConnector } from 'wagmi/connectors/walletConnect'
import { alchemyProvider } from 'wagmi/providers/alchemy'

Expand Down Expand Up @@ -43,12 +43,12 @@ export const { publicClient, chains } = configureChains(defaultChains, [
export const wagmiConfig = createConfig({
autoConnect: true,
connectors: [
new MetaMaskConnector({
new InjectedConnector({
chains,
options: {
// For disconnecting from metamask
shimDisconnect: true,
UNSTABLE_shimOnConnectSelectAccount: true,
// UNSTABLE_shimOnConnectSelectAccount: true,
},
}),
...(isTest
Expand Down
2 changes: 1 addition & 1 deletion src/components/AuthMethodFeed/AuthWalletFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const AuthWalletFeed: React.FC<Props> = ({
const [walletType, setWalletType] = useState<WalletType>('MetaMask')
const [showLoading, setShowLoading] = useState(true)

const injectedConnector = connectors.find((c) => c.id === 'metaMask')
const injectedConnector = connectors.find((c) => c.id === 'injected')
const walletConnectConnector = connectors.find(
(c) => c.id === 'walletConnect'
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Forms/SelectAuthMethodForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const SelectAuthMethodForm: React.FC<FormProps> = ({
const isWallet = authFeedType === 'wallet'

const { connectors } = useConnect()
const injectedConnector = connectors.find((c) => c.id === 'metaMask')
const injectedConnector = connectors.find((c) => c.id === 'injected')

useEffect(() => {
if (injectedConnector?.ready && checkWallet) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Forms/WalletAuthForm/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const Select: React.FC<FormProps> = ({
const { address: account, isConnecting } = useAccount()
const errorMessage = connectError?.message

const injectedConnector = connectors.find((c) => c.id === 'metaMask')
const injectedConnector = connectors.find((c) => c.id === 'injected')
const walletConnectConnector = connectors.find(
(c) => c.id === 'walletConnect'
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/GlobalDialogs/UniversalAuthDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const BaseUniversalAuthDialog = () => {
const [firstRender, setFirstRender] = useState(true)

const { connectors } = useConnect()
const injectedConnector = connectors.find((c) => c.id === 'metaMask')
const injectedConnector = connectors.find((c) => c.id === 'injected')
const [authFeedType, setAuthFeedType] = useState<AuthFeedType>('normal')

useEffect(() => {
Expand Down

0 comments on commit 3d1fd0c

Please sign in to comment.