2018-07-28 12:47:45 +05:00
|
|
|
// @flow
|
2018-02-23 17:24:00 -07:00
|
|
|
import React from 'react';
|
2019-03-04 23:46:57 -05:00
|
|
|
// @if TARGET='app'
|
2018-04-16 18:51:35 -04:00
|
|
|
import { ipcRenderer } from 'electron';
|
2019-03-04 23:46:57 -05:00
|
|
|
// @endif
|
2018-02-23 17:24:00 -07:00
|
|
|
import { Modal } from 'modal/modal';
|
2018-03-26 14:32:43 -07:00
|
|
|
import Button from 'component/button';
|
2017-12-08 05:08:50 -05:00
|
|
|
|
2018-07-28 12:47:45 +05:00
|
|
|
type Props = {
|
|
|
|
closeModal: any => any,
|
|
|
|
declineAutoUpdate: () => any,
|
|
|
|
};
|
|
|
|
|
2019-01-07 21:46:33 -05:00
|
|
|
type State = {
|
|
|
|
disabled: boolean,
|
|
|
|
};
|
|
|
|
|
|
|
|
class ModalAutoUpdateDownloaded extends React.PureComponent<Props, State> {
|
|
|
|
constructor(props: Props) {
|
2018-07-28 12:47:45 +05:00
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
disabled: false,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-12-08 05:08:50 -05:00
|
|
|
render() {
|
2018-01-17 05:50:02 -05:00
|
|
|
const { closeModal, declineAutoUpdate } = this.props;
|
2017-12-22 01:42:04 -05:00
|
|
|
|
2017-12-08 05:08:50 -05:00
|
|
|
return (
|
|
|
|
<Modal
|
2018-03-26 14:32:43 -07:00
|
|
|
isOpen
|
2017-12-22 01:42:04 -05:00
|
|
|
type="confirm"
|
2019-07-10 21:42:25 -04:00
|
|
|
contentLabel={__('Upgrade Downloaded')}
|
2018-09-26 13:48:07 -04:00
|
|
|
title={__('LBRY Leveled Up')}
|
2019-10-02 17:57:11 -05:00
|
|
|
confirmButtonLabel={__('Upgrade Now')}
|
|
|
|
abortButtonLabel={__('Not now')}
|
2018-07-28 12:47:45 +05:00
|
|
|
confirmButtonDisabled={this.state.disabled}
|
2017-12-10 03:06:30 -05:00
|
|
|
onConfirmed={() => {
|
2018-07-28 12:47:45 +05:00
|
|
|
this.setState({ disabled: true });
|
2018-02-23 17:24:00 -07:00
|
|
|
ipcRenderer.send('autoUpdateAccepted');
|
2017-12-10 03:06:30 -05:00
|
|
|
}}
|
2018-01-05 01:29:31 -05:00
|
|
|
onAborted={() => {
|
2018-01-17 05:50:02 -05:00
|
|
|
declineAutoUpdate();
|
2018-01-05 01:29:31 -05:00
|
|
|
closeModal();
|
|
|
|
}}
|
2017-12-08 05:08:50 -05:00
|
|
|
>
|
2019-07-21 17:31:22 -04:00
|
|
|
<p>{__('A new version of LBRY is ready for you.')}</p>
|
|
|
|
<p className="help">
|
|
|
|
{__('Want to know what has changed?')} See the{' '}
|
|
|
|
<Button button="link" label={__('release notes')} href="https://github.com/lbryio/lbry-desktop/releases" />.
|
|
|
|
</p>
|
2017-12-08 05:08:50 -05:00
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ModalAutoUpdateDownloaded;
|