// @flow import React, { useState } from 'react'; // @if TARGET='app' import { ipcRenderer } from 'electron'; // @endif import { Modal } from 'modal/modal'; import LastReleaseChanges from 'component/lastReleaseChanges'; type Props = { closeModal: (any) => any, declineAutoUpdate: () => any, errorWhileUpdating: boolean, }; const ModalAutoUpdateDownloaded = (props: Props) => { const { closeModal, declineAutoUpdate, errorWhileUpdating } = props; const [disabled, setDisabled] = useState(false); const isDownloading = disabled && !errorWhileUpdating; const handleConfirm = () => { setDisabled(true); ipcRenderer.send('autoUpdateAccepted'); }; const handleAbort = () => { declineAutoUpdate(); closeModal(); }; return ( {errorWhileUpdating &&

__('There was an error while updating. Please try again.')

}
); }; export default ModalAutoUpdateDownloaded;