Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
2f503421
Unverified
Commit
2f503421
authored
Jul 13, 2023
by
tom goriunov
Committed by
GitHub
Jul 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: add to metamask button is not visible (#1006)
Add to metamask button is not visible Fixes #996
parent
6365f727
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
useProvider.tsx
lib/web3/useProvider.tsx
+6
-2
Footer.pw.tsx
ui/snippets/footer/Footer.pw.tsx
+1
-1
No files found.
lib/web3/useProvider.tsx
View file @
2f503421
...
...
@@ -9,11 +9,15 @@ export default function useProvider() {
const
[
provider
,
setProvider
]
=
React
.
useState
<
WindowProvider
>
();
React
.
useEffect
(()
=>
{
if
(
!
(
'
ethereum
'
in
window
))
{
if
(
!
(
'
ethereum
'
in
window
&&
window
.
ethereum
))
{
return
;
}
window
.
ethereum
?.
providers
?.
forEach
(
async
(
provider
)
=>
{
// if user has multiple wallets installed, they all are injected in the window.ethereum.providers array
// if user has only one wallet, the provider is injected in the window.ethereum directly
const
providers
=
Array
.
isArray
(
window
.
ethereum
.
providers
)
?
window
.
ethereum
.
providers
:
[
window
.
ethereum
];
providers
.
forEach
(
async
(
provider
)
=>
{
if
(
appConfig
.
web3
.
defaultWallet
===
'
coinbase
'
&&
provider
.
isCoinbaseWallet
)
{
return
setProvider
(
provider
);
}
...
...
ui/snippets/footer/Footer.pw.tsx
View file @
2f503421
...
...
@@ -75,7 +75,7 @@ base.describe('without custom links', () => {
base
(
'
base view +@dark-mode +@mobile
'
,
async
({
mount
,
page
})
=>
{
await
page
.
evaluate
(()
=>
{
window
.
ethereum
=
{
providers
:
[
{
isMetaMask
:
true
}
]
,
isMetaMask
:
true
,
}
as
WindowProvider
;
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment