Fix install
This commit is contained in:
14
src/App.js
14
src/App.js
@@ -56,7 +56,10 @@ class App extends IPCContainer {
|
||||
}
|
||||
};
|
||||
|
||||
_isMounted = false;
|
||||
|
||||
componentDidMount() {
|
||||
this._isMounted = true;
|
||||
this.scheduledUpdateJob = Scheduler.scheduleJob('23 11 * * *', this.updateCheckScheduledJob);
|
||||
this.detectUpgrades();
|
||||
}
|
||||
@@ -75,6 +78,7 @@ class App extends IPCContainer {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this._isMounted = false;
|
||||
Scheduler.cancelJob(this.scheduledUpdateJob);
|
||||
super.componentWillUnmount();
|
||||
}
|
||||
@@ -123,7 +127,7 @@ class App extends IPCContainer {
|
||||
if (result.Success) {
|
||||
const selectedVersion = this.getSelectedVersion();
|
||||
this.props.installRelease(result.Destination, selectedVersion, () => {
|
||||
if (this.isMounted()) {
|
||||
if (this._isMounted) {
|
||||
this.checkVersionInstalled();
|
||||
}
|
||||
});
|
||||
@@ -140,7 +144,7 @@ class App extends IPCContainer {
|
||||
};
|
||||
|
||||
onDownloadFileComplete = (name, type, url, result) => {
|
||||
if (this.isMounted()) {
|
||||
if (this._isMounted) {
|
||||
switch (type) {
|
||||
case Constants.INSTALL_TYPES.Dependency:
|
||||
this.installDependency(result);
|
||||
@@ -159,7 +163,7 @@ class App extends IPCContainer {
|
||||
};
|
||||
|
||||
onInstallDependencyComplete = (source, url, result) => {
|
||||
if (this.isMounted()) {
|
||||
if (this._isMounted) {
|
||||
if (result.Success && source.toLowerCase().endsWith('.dmg')) {
|
||||
this.waitForDependencyInstall(source, url);
|
||||
} else {
|
||||
@@ -172,9 +176,9 @@ class App extends IPCContainer {
|
||||
};
|
||||
|
||||
onInstallUpgradeComplete = (source, result) => {
|
||||
if (this.isMounted() && !result.Success) {
|
||||
if (this._isMounted && !result.Success) {
|
||||
this.props.notifyError(result.Error, false,() => {
|
||||
if (this.isMounted()) {
|
||||
if (this._isMounted) {
|
||||
// TODO Prompt to verify
|
||||
if (result.AllowSkipVerification) {
|
||||
this.installUpgrade({
|
||||
|
||||
@@ -79,7 +79,7 @@ export const installRelease = (source, version, completedCallback) => {
|
||||
|
||||
const extractReleaseComplete = (event, arg) => {
|
||||
ipcRenderer.removeListener(Constants.IPC_Extract_Release_Complete, extractReleaseComplete);
|
||||
ipcRenderer.sendSync(Constants.IPC_Delete_File, {
|
||||
ipcRenderer.send(Constants.IPC_Delete_File, {
|
||||
FilePath: source,
|
||||
});
|
||||
|
||||
@@ -103,7 +103,7 @@ export const installUpgrade = (source, sha256, signature, skipVerification, comp
|
||||
|
||||
const installUpgradeComplete = (event, arg) => {
|
||||
ipcRenderer.removeListener(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete);
|
||||
ipcRenderer.sendSync(Constants.IPC_Delete_File, {
|
||||
ipcRenderer.send(Constants.IPC_Delete_File, {
|
||||
FilePath: source,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user