fix incompatible daemon modal

This commit is contained in:
Sean Yesmunt 2018-05-10 19:06:41 -04:00
parent e8fa0a5992
commit c806d10f1e
3 changed files with 25 additions and 8 deletions

View file

@ -1,8 +1,14 @@
// @flow
import React from 'react';
import { Modal } from 'modal/modal';
import Button from 'component/button';
class ModalIncompatibleDaemon extends React.PureComponent {
type Props = {
quit: () => void,
quitAnyDaemon: () => void,
};
class ModalIncompatibleDaemon extends React.PureComponent<Props> {
render() {
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. '
)}
<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>
);
}

View file

@ -251,12 +251,21 @@ export function doCheckUpgradeSubscribe() {
export function doCheckDaemonVersion() {
return dispatch => {
Lbry.version().then(({ lbrynet_version: lbrynetVersion }) => {
if (config.lbrynetDaemonVersion === lbrynetVersion) {
dispatch({
type: ACTIONS.DAEMON_VERSION_MATCH,
});
return;
}
dispatch({
type:
config.lbrynetDaemonVersion === lbrynetVersion
? ACTIONS.DAEMON_VERSION_MATCH
: ACTIONS.DAEMON_VERSION_MISMATCH,
type: ACTIONS.DAEMON_VERSION_MISMATCH,
});
dispatch(
doNotify({
id: MODALS.INCOMPATIBLE_DAEMON,
})
);
});
};
}

View file

@ -1,7 +1,6 @@
// @flow
import * as ACTIONS from 'constants/action_types';
import { MODALS } from 'lbry-redux';
import { remote } from 'electron';
@ -74,7 +73,6 @@ reducers[ACTIONS.DAEMON_VERSION_MATCH] = state =>
reducers[ACTIONS.DAEMON_VERSION_MISMATCH] = state =>
Object.assign({}, state, {
daemonVersionMatched: false,
modal: MODALS.INCOMPATIBLE_DAEMON,
});
reducers[ACTIONS.UPGRADE_CANCELLED] = state =>