Add ability to decline updates

This commit is contained in:
Alex Liebowitz 2017-12-22 01:42:04 -05:00
parent acec4a745f
commit bc15d24d66
3 changed files with 13 additions and 1 deletions

View file

@ -21,6 +21,8 @@ const isDevelopment = process.env.NODE_ENV === 'development';
// For now, log info messages in production for easier debugging of built apps
log.transports.file.level = 'info';
autoUpdater.autoDownload = true;
// Misc constants
const LATEST_RELEASE_API_URL = 'https://api.github.com/repos/lbryio/lbry-app/releases/latest';

View file

@ -1,5 +1,10 @@
import React from "react";
import { connect } from "react-redux";
import { doCloseModal } from "redux/actions/app";
import ModalAutoUpdateDownloaded from "./view";
export default connect(null, null)(ModalAutoUpdateDownloaded);
const perform = dispatch => ({
closeModal: () => dispatch(doCloseModal()),
});
export default connect(null, perform)(ModalAutoUpdateDownloaded);

View file

@ -7,14 +7,19 @@ const { ipcRenderer } = require("electron");
class ModalAutoUpdateDownloaded extends React.PureComponent {
render() {
const { closeModal } = this.props;
return (
<Modal
isOpen={true}
type="confirm"
contentLabel={__("Update downloaded")}
confirmButtonLabel={__("Update and Restart")}
abortButtonLabel={__("Don't Update")}
onConfirmed={() => {
ipcRenderer.send("autoUpdate");
}}
onAborted={closeModal}
>
<section>
<h3 className="text-center">{__("LBRY Leveled Up")}</h3>