Remove upgrade overlay (API with runtime upgrade support) (#2291)
* Remove upgrade overlay (API with runtime upgrade support) * Bump deps
This commit is contained in:
parent
19236cfc69
commit
433c06690a
@ -10,10 +10,10 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"@polkadot/api": "^1.4.0-beta.7",
|
||||
"@polkadot/api-contract": "^1.4.0-beta.7",
|
||||
"@polkadot/api": "^1.4.0-beta.9",
|
||||
"@polkadot/api-contract": "^1.4.0-beta.9",
|
||||
"@polkadot/keyring": "^2.4.1",
|
||||
"@polkadot/types": "^1.4.0-beta.7",
|
||||
"@polkadot/types": "^1.4.0-beta.9",
|
||||
"@polkadot/util": "^2.4.1",
|
||||
"@polkadot/util-crypto": "^2.4.1",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
|
||||
@ -12,6 +12,6 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.8.4",
|
||||
"@polkadot/api-contract": "^1.4.0-beta.7"
|
||||
"@polkadot/api-contract": "^1.4.0-beta.9"
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@ import Signer from '@polkadot/react-signer';
|
||||
|
||||
import AccountsOverlay from './overlays/Accounts';
|
||||
import ConnectingOverlay from './overlays/Connecting';
|
||||
import UpgradeOverlay from './overlays/Upgrade';
|
||||
import { SideBarTransition, SIDEBAR_MENU_THRESHOLD } from './constants';
|
||||
import Content from './Content';
|
||||
import SideBar from './SideBar';
|
||||
@ -90,7 +89,6 @@ function Apps ({ className }: Props): React.ReactElement<Props> {
|
||||
</Signer>
|
||||
<ConnectingOverlay />
|
||||
<AccountsOverlay />
|
||||
<UpgradeOverlay />
|
||||
</div>
|
||||
<WarmUp />
|
||||
</>
|
||||
|
||||
@ -1,68 +0,0 @@
|
||||
// Copyright 2017-2020 @polkadot/apps authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { RuntimeVersion } from '@polkadot/types/interfaces';
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Button } from '@polkadot/react-components';
|
||||
import { useApi, useCall } from '@polkadot/react-hooks';
|
||||
|
||||
import { useTranslation } from '../translate';
|
||||
import BaseOverlay from './Base';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
let lastVersion = -1;
|
||||
|
||||
export default function Upgrade ({ className }: Props): React.ReactElement<Props> | null {
|
||||
const { t } = useTranslation();
|
||||
const { api, isApiReady, isApiConnected } = useApi();
|
||||
const runtimeVersion = useCall<RuntimeVersion>(api.rpc.state.subscribeRuntimeVersion, []);
|
||||
const [hasUpgraded, setHasUpgraded] = useState(false);
|
||||
|
||||
useEffect((): void => {
|
||||
if (!hasUpgraded && runtimeVersion) {
|
||||
const version = runtimeVersion.specVersion.toNumber();
|
||||
|
||||
if (lastVersion === -1) {
|
||||
lastVersion = version;
|
||||
}
|
||||
|
||||
const newStatus = lastVersion !== version;
|
||||
|
||||
if (newStatus !== hasUpgraded) {
|
||||
setHasUpgraded(newStatus);
|
||||
}
|
||||
|
||||
lastVersion = version;
|
||||
}
|
||||
}, [hasUpgraded, runtimeVersion]);
|
||||
|
||||
if (!isApiReady || !isApiConnected || !hasUpgraded || !runtimeVersion) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const _onReload = (): void => {
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
return (
|
||||
<BaseOverlay
|
||||
className={className}
|
||||
icon='users'
|
||||
type='info'
|
||||
>
|
||||
<p>{t(`The runtime has been upgraded to ${runtimeVersion.specVersion.toNumber()}, your current interface would need to be refreshed to take advantage of the new features.`)}</p>
|
||||
<p>
|
||||
<Button
|
||||
icon='refresh'
|
||||
label={t('Reload')}
|
||||
onClick={_onReload}
|
||||
/>
|
||||
</p>
|
||||
</BaseOverlay>
|
||||
);
|
||||
}
|
||||
@ -31,7 +31,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.8.4",
|
||||
"@polkadot/api": "^1.4.0-beta.7",
|
||||
"@polkadot/api": "^1.4.0-beta.9",
|
||||
"@polkadot/extension-dapp": "^0.22.0-beta.4",
|
||||
"edgeware-node-types": "^1.1.0",
|
||||
"rxjs-compat": "^6.5.3"
|
||||
|
||||
108
yarn.lock
108
yarn.lock
@ -2200,47 +2200,47 @@
|
||||
dependencies:
|
||||
"@types/node" ">= 8"
|
||||
|
||||
"@polkadot/api-contract@^1.4.0-beta.7":
|
||||
version "1.4.0-beta.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-1.4.0-beta.7.tgz#19cca9c61b3d3da145fc5072a10c6c3a97c4ea93"
|
||||
integrity sha512-/rA3B+ZkqSBGi0Zs+AZx9aiHtHg0vxyLrfkIh2mxIThSE7i/TTAXJs6ioRSisOP+WlR2xHamy4OAVRqci7o4Vg==
|
||||
"@polkadot/api-contract@^1.4.0-beta.9":
|
||||
version "1.4.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-1.4.0-beta.9.tgz#9a4eb7b642994137106405fbe9c2e243eebd1c1b"
|
||||
integrity sha512-0/iMNEyPX2jLZgmUyAVhfATZ++rD/plf25CtJxCF6uFKGXb6/XgayHuoNz/N/5NGZdEPebeuwZGS8qI6hgjMyQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.4"
|
||||
"@polkadot/api" "^1.4.0-beta.7"
|
||||
"@polkadot/rpc-core" "^1.4.0-beta.7"
|
||||
"@polkadot/types" "^1.4.0-beta.7"
|
||||
"@polkadot/api" "^1.4.0-beta.9"
|
||||
"@polkadot/rpc-core" "^1.4.0-beta.9"
|
||||
"@polkadot/types" "^1.4.0-beta.9"
|
||||
"@polkadot/util" "^2.4.1"
|
||||
bn.js "^5.1.1"
|
||||
rxjs "^6.5.4"
|
||||
|
||||
"@polkadot/api-derive@^1.4.0-beta.7":
|
||||
version "1.4.0-beta.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-1.4.0-beta.7.tgz#89197938e0733eb50d0337c602480e85194d8af8"
|
||||
integrity sha512-KyEtVNyBc27apZ9X5STYWNUHts8FzJV4N7v4WYi5iz1DeX3Xx+goDJom9RUpa3Km5JPKhuOuSwnqp5sP/yf8oA==
|
||||
"@polkadot/api-derive@^1.4.0-beta.9":
|
||||
version "1.4.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-1.4.0-beta.9.tgz#bb2f8426b7263b3c5d60e55d223b0c6584907654"
|
||||
integrity sha512-lFr3o/pvjPmgsa4xJ977iI3Qwl2zx40FPJIr73X7dGLpkjvIYubHaCi8E1CIiqrRbl+gjlUlzDd7nxjdfzVV0w==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.4"
|
||||
"@polkadot/api" "^1.4.0-beta.7"
|
||||
"@polkadot/rpc-core" "^1.4.0-beta.7"
|
||||
"@polkadot/rpc-provider" "^1.4.0-beta.7"
|
||||
"@polkadot/types" "^1.4.0-beta.7"
|
||||
"@polkadot/api" "^1.4.0-beta.9"
|
||||
"@polkadot/rpc-core" "^1.4.0-beta.9"
|
||||
"@polkadot/rpc-provider" "^1.4.0-beta.9"
|
||||
"@polkadot/types" "^1.4.0-beta.9"
|
||||
"@polkadot/util" "^2.4.1"
|
||||
"@polkadot/util-crypto" "^2.4.1"
|
||||
bn.js "^5.1.1"
|
||||
memoizee "^0.4.14"
|
||||
rxjs "^6.5.4"
|
||||
|
||||
"@polkadot/api@^1.4.0-beta.7":
|
||||
version "1.4.0-beta.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-1.4.0-beta.7.tgz#a438b3851098f457e08143479c356e55a7947bae"
|
||||
integrity sha512-DSQ11luu9kUtZpjuAKBhXSDSa1B/mEayeoCwcvMKYTuRma9j1VYNfSHpf5AxC/UnzUek8AzzvnqHaf5arPiTkQ==
|
||||
"@polkadot/api@^1.4.0-beta.9":
|
||||
version "1.4.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-1.4.0-beta.9.tgz#45f3ff3b916c1d168701c1886c0a2a7e30e971ce"
|
||||
integrity sha512-MgaYvECowbDadBMO9WTpAi1CoAj6THIlNREVAJ5useHR1s9T4ehsjXMK9ZtczMBYte1+jlazVvHmSR4+FQFT9w==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.4"
|
||||
"@polkadot/api-derive" "^1.4.0-beta.7"
|
||||
"@polkadot/api-derive" "^1.4.0-beta.9"
|
||||
"@polkadot/keyring" "^2.4.1"
|
||||
"@polkadot/metadata" "^1.4.0-beta.7"
|
||||
"@polkadot/rpc-core" "^1.4.0-beta.7"
|
||||
"@polkadot/rpc-provider" "^1.4.0-beta.7"
|
||||
"@polkadot/types" "^1.4.0-beta.7"
|
||||
"@polkadot/metadata" "^1.4.0-beta.9"
|
||||
"@polkadot/rpc-core" "^1.4.0-beta.9"
|
||||
"@polkadot/rpc-provider" "^1.4.0-beta.9"
|
||||
"@polkadot/types" "^1.4.0-beta.9"
|
||||
"@polkadot/util" "^2.4.1"
|
||||
"@polkadot/util-crypto" "^2.4.1"
|
||||
bn.js "^5.1.1"
|
||||
@ -2323,13 +2323,13 @@
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.4"
|
||||
|
||||
"@polkadot/jsonrpc@^1.4.0-beta.7":
|
||||
version "1.4.0-beta.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-1.4.0-beta.7.tgz#6aa5f85897089dc35eb02a8d1e62f824d1abed6a"
|
||||
integrity sha512-iispV4uOysKUHVcftS3INOgmQJjV83FtkygpKi/atH7c0C824kU7lLTc7WtbnYr7YKHQgGeE83v5dpdQsa1RkQ==
|
||||
"@polkadot/jsonrpc@^1.4.0-beta.9":
|
||||
version "1.4.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-1.4.0-beta.9.tgz#ecba052c4e92c43d2a1bc0b1286782a1098b4ebc"
|
||||
integrity sha512-8od7a2RKEVuhsTX939ntJwTThhzo2gzQULBodWoLerptSbiZCvr14KFPfyPC4c5z4aesugi0L53oPF/E7iRETA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.4"
|
||||
"@polkadot/types" "^1.4.0-beta.7"
|
||||
"@polkadot/types" "^1.4.0-beta.9"
|
||||
"@polkadot/util" "^2.4.1"
|
||||
|
||||
"@polkadot/keyring@^2.4.1":
|
||||
@ -2341,13 +2341,13 @@
|
||||
"@polkadot/util" "^2.4.1"
|
||||
"@polkadot/util-crypto" "^2.4.1"
|
||||
|
||||
"@polkadot/metadata@^1.4.0-beta.7":
|
||||
version "1.4.0-beta.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-1.4.0-beta.7.tgz#df463ed13b32a7cc178cbcdc9f5cb99b9ec18cd0"
|
||||
integrity sha512-w2ss75ubPIg+Zj5lX28BBf4k21O/2jLCoL/xuI7+zTqGZH3oXOYO4XPX/KAKDGduixysTfz3YfMUR47Z/7ndmw==
|
||||
"@polkadot/metadata@^1.4.0-beta.9":
|
||||
version "1.4.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-1.4.0-beta.9.tgz#b2cd8f9ca31407d96c13231d0cf8ef0661813f26"
|
||||
integrity sha512-z+0eI5yJ0o1z/V7YGXduRUovhGif/RSYEgB1E4LZB2mOvFTDzwgxoWBCmJylaN6nNsKaS0L6fr1mlBfx+2n6UQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.4"
|
||||
"@polkadot/types" "^1.4.0-beta.7"
|
||||
"@polkadot/types" "^1.4.0-beta.9"
|
||||
"@polkadot/util" "^2.4.1"
|
||||
"@polkadot/util-crypto" "^2.4.1"
|
||||
bn.js "^5.1.1"
|
||||
@ -2374,29 +2374,29 @@
|
||||
qrcode-generator "^1.4.4"
|
||||
react-qr-reader "^2.2.1"
|
||||
|
||||
"@polkadot/rpc-core@^1.4.0-beta.7":
|
||||
version "1.4.0-beta.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-1.4.0-beta.7.tgz#2dfe6700fa83473d06d0cf63f4db078a7dd8dfe3"
|
||||
integrity sha512-/0EGoYXvXw21KbN+Swh2sWiTozyIqT432Texi/2DpOjtYse7rKJ3uWImho8/nQK/HE1La1M83B3mbz6DoFrQtQ==
|
||||
"@polkadot/rpc-core@^1.4.0-beta.9":
|
||||
version "1.4.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-1.4.0-beta.9.tgz#1888745f88bd39e03341e6df5d80b336a4e62fd7"
|
||||
integrity sha512-PegsmzwIFT+6wY098OGNE2DIkmM2xeuQ23qRGGEJ68fIz4OVh3cZD8yfPjwRcN96ku1xkLP7KON9OX4V8Vgxxw==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.4"
|
||||
"@polkadot/jsonrpc" "^1.4.0-beta.7"
|
||||
"@polkadot/metadata" "^1.4.0-beta.7"
|
||||
"@polkadot/rpc-provider" "^1.4.0-beta.7"
|
||||
"@polkadot/types" "^1.4.0-beta.7"
|
||||
"@polkadot/jsonrpc" "^1.4.0-beta.9"
|
||||
"@polkadot/metadata" "^1.4.0-beta.9"
|
||||
"@polkadot/rpc-provider" "^1.4.0-beta.9"
|
||||
"@polkadot/types" "^1.4.0-beta.9"
|
||||
"@polkadot/util" "^2.4.1"
|
||||
memoizee "^0.4.14"
|
||||
rxjs "^6.5.4"
|
||||
|
||||
"@polkadot/rpc-provider@^1.4.0-beta.7":
|
||||
version "1.4.0-beta.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-1.4.0-beta.7.tgz#fa07781b2ae77dac85bac21bb36ffc55863c28d0"
|
||||
integrity sha512-Ke0UJqFQCVL7JI8hoSNnmVnXfnyvgef8oYGXczWPSX+aQyPa+wZbd6PPZl52QpHK0I3hLBUcC+/sAr6lzufR7w==
|
||||
"@polkadot/rpc-provider@^1.4.0-beta.9":
|
||||
version "1.4.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-1.4.0-beta.9.tgz#421bd089fd57cac3abc0db57d2bd97be29015e97"
|
||||
integrity sha512-gdanGtSZNcRLyerur6N9lZeSzpxO7ABiezXYhAGsqSwRkH32tVEwwLH1TVjg2dnBSFm4F9Wq//xfG/MhhOyn2A==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.4"
|
||||
"@polkadot/jsonrpc" "^1.4.0-beta.7"
|
||||
"@polkadot/metadata" "^1.4.0-beta.7"
|
||||
"@polkadot/types" "^1.4.0-beta.7"
|
||||
"@polkadot/jsonrpc" "^1.4.0-beta.9"
|
||||
"@polkadot/metadata" "^1.4.0-beta.9"
|
||||
"@polkadot/types" "^1.4.0-beta.9"
|
||||
"@polkadot/util" "^2.4.1"
|
||||
"@polkadot/util-crypto" "^2.4.1"
|
||||
bn.js "^5.1.1"
|
||||
@ -2411,13 +2411,13 @@
|
||||
dependencies:
|
||||
"@types/chrome" "^0.0.95"
|
||||
|
||||
"@polkadot/types@^1.4.0-beta.7":
|
||||
version "1.4.0-beta.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-1.4.0-beta.7.tgz#8abce88b36ffad1170d649a30bcf623c2eaee9f9"
|
||||
integrity sha512-0KkiJ+JyliowQBy7ePSkodDcUHSfUuO/p7WIg8LTH09ARvZuxp+YtOw/lrtImbnEhtnUUAShfjylMLms1wAsEw==
|
||||
"@polkadot/types@^1.4.0-beta.9":
|
||||
version "1.4.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-1.4.0-beta.9.tgz#e981e683d5d32733a0da0300897a50f1c595a4ff"
|
||||
integrity sha512-UJlxLn4X5/dIkLo1G9cBfDBjzJWxe5yVCjfkBR7i+1S3CPeOWrqw2iwSl2a+0kdvqQqjBWLcXw49m+mdUdKOqQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.4"
|
||||
"@polkadot/metadata" "^1.4.0-beta.7"
|
||||
"@polkadot/metadata" "^1.4.0-beta.9"
|
||||
"@polkadot/util" "^2.4.1"
|
||||
"@polkadot/util-crypto" "^2.4.1"
|
||||
"@types/bn.js" "^4.11.6"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user