web: fail slightly more gracefully when MetaMask is not installed
Also adds a page title.
This commit is contained in:
parent
35d265b9c8
commit
6cc3495ac5
|
@ -24,7 +24,7 @@
|
|||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
<title>Wormhole Demonstration UI</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
|
|
@ -13,6 +13,11 @@ import {PublicKey, Transaction} from "@solana/web3.js";
|
|||
import KeyContext from "../providers/KeyContext";
|
||||
import ClientContext from "../providers/ClientContext";
|
||||
|
||||
// @ts-ignore
|
||||
if (window.ethereum === undefined) {
|
||||
alert("Please install the MetaMask extension before using this experimental demo web UI");
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
window.ethereum.enable();
|
||||
// @ts-ignore
|
||||
|
|
|
@ -16,6 +16,10 @@ import * as spl from "@solana/spl-token";
|
|||
import BN from "bn.js"
|
||||
import {SlotContext} from "../providers/SlotContext";
|
||||
|
||||
// @ts-ignore
|
||||
if (window.ethereum === undefined) {
|
||||
alert("Please install the MetaMask extension before using this experimental demo web UI");
|
||||
}
|
||||
|
||||
const {Step} = Steps;
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ import {FormInstance} from "antd/lib/form";
|
|||
import SplBalances from "../components/SplBalances";
|
||||
import TransferProposals from "../components/TransferProposals";
|
||||
|
||||
// @ts-ignore
|
||||
if (window.ethereum === undefined) {
|
||||
alert("Please install the MetaMask extension before using this experimental demo web UI");
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
window.ethereum.enable();
|
||||
|
|
Loading…
Reference in New Issue