Skip to content

Commit

Permalink
Merge pull request #225 from nspcc-dev/feature/212-handle_misconfigur…
Browse files Browse the repository at this point in the history
…ed_connections

Handle misconfigured wallet connections
  • Loading branch information
roman-khimov authored Sep 4, 2024
2 parents be64c27 + 937abe6 commit ba4a830
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
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

0 comments on commit ba4a830

Please sign in to comment.