diff --git a/package-lock.json b/package-lock.json
index 448808d8d1a6ca367b0c85738ef838eca71ee6cc..1401e5b85eabc327ecd3e3864cdfafb943bbbf09 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -525,13 +525,6 @@
"@parity/jsonrpc": "2.1.5",
"@parity/ledger": "2.1.2",
"@parity/shared": "2.2.25"
- },
- "dependencies": {
- "@parity/jsonrpc": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@parity/jsonrpc/-/jsonrpc-2.1.5.tgz",
- "integrity": "sha512-M6aLgssTfqloNgVFuzxSQ3J5RJ5T9g4a4wka1QVumaud7e4ubFjuJgR0F+0aQ/H1zdiTSMDHSmoaeAp8UoE4fA=="
- }
}
},
"@parity/plugin-signer-account": {
diff --git a/package.json b/package.json
index 3cdc46eecd291881f5d77e210c36c737bf3f1863..bd3a28821a59e57e23ee14cdbcf1d3d092d7ffc2 100644
--- a/package.json
+++ b/package.json
@@ -149,6 +149,7 @@
},
"dependencies": {
"@parity/api": "2.1.20",
+ "@parity/mobx": "1.1.2",
"@parity/plugin-signer-account": "github:parity-js/plugin-signer-account#3acd84ba1965f9ee419edd04d84e13e097e6d661",
"@parity/plugin-signer-default": "github:parity-js/plugin-signer-default#dcf8cf23bb050070b6a691413b974b5c2d7d1ce6",
"@parity/plugin-signer-hardware": "github:parity-js/plugin-signer-hardware#e8b8a4e67adc37870e370d22805632d08012b9ee",
diff --git a/src/Connection/connection.js b/src/Connection/connection.js
index 2cc2073e9d45285c5ed8d1596f92e30bb95b826d..934256f908e29bd61a120aaaceea85687600301c 100644
--- a/src/Connection/connection.js
+++ b/src/Connection/connection.js
@@ -18,7 +18,9 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';
import { FormattedMessage } from 'react-intl';
import isElectron from 'is-electron';
+import { observer } from 'mobx-react';
import PropTypes from 'prop-types';
+import stores from '@parity/mobx';
import GradientBg from '@parity/ui/lib/GradientBg';
import Icon from 'semantic-ui-react/dist/commonjs/elements/Icon';
@@ -33,6 +35,7 @@ if (isElectron()) {
electron = window.require('electron');
}
+@observer
class Connection extends Component {
static contextTypes = {
api: PropTypes.object.isRequired
@@ -51,6 +54,8 @@ class Connection extends Component {
validToken: false
}
+ versionInfoStore = stores.parity.versionInfo().get(this.context.api)
+
componentDidMount () {
if (isElectron()) {
const { ipcRenderer, remote } = electron;
@@ -75,6 +80,18 @@ class Connection extends Component {
}
}
+ /**
+ * Electron UI requires parity version >=1.10.0
+ */
+ isVersionCorrect = () => {
+ const { versionInfo } = this.versionInfoStore;
+
+ if (!versionInfo) { return true; } // Simpler to return true when pinging for parity_versionInfo
+ const { version: { major, minor } } = versionInfo;
+
+ return major > 1 || (major === 1 && minor >= 10);
+ }
+
handleOpenWebsite = () => {
const { shell } = electron;
@@ -82,10 +99,9 @@ class Connection extends Component {
}
render () {
- const { isConnecting, isConnected, needsToken } = this.props;
- const { parityInstallLocation } = this.state;
+ const { isConnecting, isConnected } = this.props;
- if (!isConnecting && isConnected) {
+ if (!isConnecting && isConnected && this.isVersionCorrect()) {
return null;
}
@@ -102,28 +118,35 @@ class Connection extends Component {