Skip to content

Commit

Permalink
feat(auth): use injected connector instead of metamask connector
Browse files Browse the repository at this point in the history
  • Loading branch information
gitwoz committed Sep 5, 2024
1 parent ed6efd3 commit 195827b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 195827b

Please sign in to comment.