Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle misconfigured wallet connections #225

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<meta property="og:image" content="/img/cover.png">
<meta name="keywords" content="NeoFS,Neo,Blockchain,智能经济,区块链">
<meta name="theme-color" content="#ffffff" />
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://verify.walletconnect.com/; script-src 'self'; connect-src 'self' http://127.0.0.1:60004 https://dapi.o3.app:60003 https://rest.t5.fs.neo.org https://rest.fs.neo.org wss://relay.walletconnect.com; style-src 'unsafe-inline' 'self'; font-src 'self'; img-src 'self';">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://verify.walletconnect.com/; script-src 'self'; connect-src 'self' http://127.0.0.1:60004 ws://127.0.0.1:60004 https://dapi.o3.app:60003 https://rest.t5.fs.neo.org https://rest.fs.neo.org wss://relay.walletconnect.com; style-src 'unsafe-inline' 'self'; font-src 'self'; img-src 'self';">
</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@ export const App = () => {
</div>
</CopyToClipboard>
<div className='btns_group'>
{console.log()}
<a
href={`https://dora.coz.io/transaction/neo3/${activeNet.toLowerCase()}/${modal.text}`}
target="_blank"
Expand Down
6 changes: 6 additions & 0 deletions src/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ const Profile = ({
<div>Check web app configuration or try later</div>
</Box>
)}
{walletData.net.toLowerCase().indexOf(activeNet.toLowerCase()) === -1 && (
<Box style={{ fontSize: 14, wordBreak: 'break-all', background: '#fece0f' }}>
<div style={{ fontSize: 20, fontWeight: 'bold' }}>{`Сonnected wallet uses ${walletData.net} network`}</div>
<div>{`Panel is configured for ${activeNet}, mismatching networks can lead to incorrect behavior.`}</div>
</Box>
)}
<Box id="account">
<Heading style={{ marginBottom: 15 }} weight="bold">
<span style={{ margin: '0 15px 0 0' }}>{formatAddress(walletData.account.address)}</span>
Expand Down
Loading