fix incompatible daemon modal
This commit is contained in:
parent
e8fa0a5992
commit
c806d10f1e
3 changed files with 25 additions and 8 deletions
|
@ -1,8 +1,14 @@
|
||||||
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Modal } from 'modal/modal';
|
import { Modal } from 'modal/modal';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
|
|
||||||
class ModalIncompatibleDaemon extends React.PureComponent {
|
type Props = {
|
||||||
|
quit: () => void,
|
||||||
|
quitAnyDaemon: () => void,
|
||||||
|
};
|
||||||
|
|
||||||
|
class ModalIncompatibleDaemon extends React.PureComponent<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { quit, quitAnyDaemon } = this.props;
|
const { quit, quitAnyDaemon } = this.props;
|
||||||
|
|
||||||
|
@ -19,7 +25,11 @@ class ModalIncompatibleDaemon extends React.PureComponent {
|
||||||
{__(
|
{__(
|
||||||
'This browser is running with an incompatible version of the LBRY protocol and your install must be repaired. '
|
'This browser is running with an incompatible version of the LBRY protocol and your install must be repaired. '
|
||||||
)}
|
)}
|
||||||
<Button label={__('Learn more')} href="https://lbry.io/faq/incompatible-protocol-version" />
|
<Button
|
||||||
|
button="link"
|
||||||
|
label={__('Learn more')}
|
||||||
|
href="https://lbry.io/faq/incompatible-protocol-version"
|
||||||
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,12 +251,21 @@ export function doCheckUpgradeSubscribe() {
|
||||||
export function doCheckDaemonVersion() {
|
export function doCheckDaemonVersion() {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
Lbry.version().then(({ lbrynet_version: lbrynetVersion }) => {
|
Lbry.version().then(({ lbrynet_version: lbrynetVersion }) => {
|
||||||
|
if (config.lbrynetDaemonVersion === lbrynetVersion) {
|
||||||
|
dispatch({
|
||||||
|
type: ACTIONS.DAEMON_VERSION_MATCH,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type:
|
type: ACTIONS.DAEMON_VERSION_MISMATCH,
|
||||||
config.lbrynetDaemonVersion === lbrynetVersion
|
|
||||||
? ACTIONS.DAEMON_VERSION_MATCH
|
|
||||||
: ACTIONS.DAEMON_VERSION_MISMATCH,
|
|
||||||
});
|
});
|
||||||
|
dispatch(
|
||||||
|
doNotify({
|
||||||
|
id: MODALS.INCOMPATIBLE_DAEMON,
|
||||||
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import * as ACTIONS from 'constants/action_types';
|
import * as ACTIONS from 'constants/action_types';
|
||||||
import { MODALS } from 'lbry-redux';
|
|
||||||
|
|
||||||
import { remote } from 'electron';
|
import { remote } from 'electron';
|
||||||
|
|
||||||
|
@ -74,7 +73,6 @@ reducers[ACTIONS.DAEMON_VERSION_MATCH] = state =>
|
||||||
reducers[ACTIONS.DAEMON_VERSION_MISMATCH] = state =>
|
reducers[ACTIONS.DAEMON_VERSION_MISMATCH] = state =>
|
||||||
Object.assign({}, state, {
|
Object.assign({}, state, {
|
||||||
daemonVersionMatched: false,
|
daemonVersionMatched: false,
|
||||||
modal: MODALS.INCOMPATIBLE_DAEMON,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
reducers[ACTIONS.UPGRADE_CANCELLED] = state =>
|
reducers[ACTIONS.UPGRADE_CANCELLED] = state =>
|
||||||
|
|
Loading…
Reference in a new issue