web: fail slightly more gracefully when MetaMask is not installed

Also adds a page title.
This commit is contained in:
Leo 2020-11-10 19:36:55 +01:00
parent 35d265b9c8
commit 6cc3495ac5
4 changed files with 14 additions and 1 deletions

View File

@ -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>

View File

@ -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

View File

@ -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;

View File

@ -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();