Handle unmount
This commit is contained in:
@@ -32,8 +32,6 @@ class App extends IPCContainer {
|
||||
this.setRequestHandler(Constants.IPC_Get_State_Reply, this.onGetStateReply);
|
||||
this.setRequestHandler(Constants.IPC_Install_Dependency_Reply, this.onInstallDependencyReply);
|
||||
this.setRequestHandler(Constants.IPC_Install_Upgrade_Reply, this.onInstallUpgradeReply);
|
||||
|
||||
Scheduler.scheduleJob('23 11 * * *', this.updateCheckScheduledJob);
|
||||
}
|
||||
|
||||
state = {
|
||||
@@ -89,6 +87,7 @@ class App extends IPCContainer {
|
||||
|
||||
componentDidMount() {
|
||||
this.sendRequest(Constants.IPC_Get_State);
|
||||
this.scheduledUpdateJob = Scheduler.scheduleJob('23 11 * * *', this.updateCheckScheduledJob);
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
@@ -104,6 +103,11 @@ class App extends IPCContainer {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
Scheduler.cancelJob(this.scheduledUpdateJob);
|
||||
super.componentWillUnmount();
|
||||
}
|
||||
|
||||
extractFileNameFromURL = url => {
|
||||
const parts = url.split('/');
|
||||
return parts[parts.length - 1];
|
||||
|
||||
Reference in New Issue
Block a user