Add "auto update downloaded" modal

This commit is contained in:
Alex Liebowitz 2017-12-08 05:08:50 -05:00
parent e39470c3cc
commit 5fff24b0fb
4 changed files with 40 additions and 0 deletions

View file

@ -2,6 +2,7 @@ export const CONFIRM_FILE_REMOVE = 'confirmFileRemove';
export const INCOMPATIBLE_DAEMON = 'incompatibleDaemon'; export const INCOMPATIBLE_DAEMON = 'incompatibleDaemon';
export const FILE_TIMEOUT = 'file_timeout'; export const FILE_TIMEOUT = 'file_timeout';
export const DOWNLOADING = 'downloading'; export const DOWNLOADING = 'downloading';
export const AUTO_UPDATE_DOWNLOADED = "auto_update_downloaded";
export const ERROR = 'error'; export const ERROR = 'error';
export const INSUFFICIENT_CREDITS = 'insufficient_credits'; export const INSUFFICIENT_CREDITS = 'insufficient_credits';
export const UPGRADE = 'upgrade'; export const UPGRADE = 'upgrade';

View file

@ -0,0 +1,5 @@
import React from "react";
import { connect } from "react-redux";
import ModalAutoUpdateDownloaded from "./view";
export default connect(null, null)(ModalAutoUpdateDownloaded);

View file

@ -0,0 +1,31 @@
import React from "react";
import { Modal } from "modal/modal";
import { Line } from "rc-progress";
import Link from "component/link/index";
const { remote } = require("electron");
const { autoUpdater } = remote.require("electron-updater");
class ModalAutoUpdateDownloaded extends React.PureComponent {
render() {
return (
<Modal
isOpen={true}
contentLabel={__("Update downloaded")}
confirmButtonLabel={__("Update and Restart")}
onConfirmed={autoUpdater.quitAndInstall()}
>
<section>
<h3 className="text-center">{__("LBRY Leveled Up")}</h3>
<p>
{__(
"A new version of LBRY has been downloaded and is ready to install."
)}
</p>
</section>
</Modal>
);
}
}
export default ModalAutoUpdateDownloaded;

View file

@ -2,6 +2,7 @@ import React from 'react';
import ModalError from 'modal/modalError'; import ModalError from 'modal/modalError';
import ModalAuthFailure from 'modal/modalAuthFailure'; import ModalAuthFailure from 'modal/modalAuthFailure';
import ModalDownloading from 'modal/modalDownloading'; import ModalDownloading from 'modal/modalDownloading';
import ModalAutoUpdateDownloaded from "modal/modalAutoUpdateDownloaded";
import ModalUpgrade from 'modal/modalUpgrade'; import ModalUpgrade from 'modal/modalUpgrade';
import ModalWelcome from 'modal/modalWelcome'; import ModalWelcome from 'modal/modalWelcome';
import ModalFirstReward from 'modal/modalFirstReward'; import ModalFirstReward from 'modal/modalFirstReward';
@ -102,6 +103,8 @@ class ModalRouter extends React.PureComponent {
return <ModalUpgrade {...modalProps} />; return <ModalUpgrade {...modalProps} />;
case modals.DOWNLOADING: case modals.DOWNLOADING:
return <ModalDownloading {...modalProps} />; return <ModalDownloading {...modalProps} />;
case modals.AUTO_UPDATE_DOWNLOADED:
return <ModalAutoUpdateDownloaded {...modalProps} />;
case modals.ERROR: case modals.ERROR:
return <ModalError {...modalProps} />; return <ModalError {...modalProps} />;
case modals.FILE_TIMEOUT: case modals.FILE_TIMEOUT: