Disable confirm button after pressing "Use It Now" button #1831
1 changed files with 17 additions and 1 deletions
|
@ -1,9 +1,23 @@
|
||||||
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import { Modal } from 'modal/modal';
|
import { Modal } from 'modal/modal';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
|
|
||||||
class ModalAutoUpdateDownloaded extends React.PureComponent {
|
type Props = {
|
||||||
|
closeModal: any => any,
|
||||||
|
declineAutoUpdate: () => any,
|
||||||
|
};
|
||||||
|
|
||||||
|
class ModalAutoUpdateDownloaded extends React.PureComponent<Props> {
|
||||||
|
constructor(props: ModalProps) {
|
||||||
|
super(props);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
disabled: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { closeModal, declineAutoUpdate } = this.props;
|
const { closeModal, declineAutoUpdate } = this.props;
|
||||||
|
|
||||||
|
@ -14,7 +28,9 @@ class ModalAutoUpdateDownloaded extends React.PureComponent {
|
||||||
contentLabel={__('Update Downloaded')}
|
contentLabel={__('Update Downloaded')}
|
||||||
confirmButtonLabel={__('Use it Now')}
|
confirmButtonLabel={__('Use it Now')}
|
||||||
abortButtonLabel={__('Upgrade on Close')}
|
abortButtonLabel={__('Upgrade on Close')}
|
||||||
|
confirmButtonDisabled={this.state.disabled}
|
||||||
onConfirmed={() => {
|
onConfirmed={() => {
|
||||||
|
this.setState({ disabled: true });
|
||||||
ipcRenderer.send('autoUpdateAccepted');
|
ipcRenderer.send('autoUpdateAccepted');
|
||||||
}}
|
}}
|
||||||
onAborted={() => {
|
onAborted={() => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue