diff --git a/src/App.js b/src/App.js index 7bfbade..1b15064 100644 --- a/src/App.js +++ b/src/App.js @@ -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];