From 359152ad02d3a4ac334219213c69f3dc28f27789 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Tue, 15 Dec 2015 17:20:57 +0100 Subject: [PATCH] fix missing cleanup --- webapp/pages/getipfs.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/pages/getipfs.jsx b/webapp/pages/getipfs.jsx index 942ad14..4908677 100644 --- a/webapp/pages/getipfs.jsx +++ b/webapp/pages/getipfs.jsx @@ -24,8 +24,11 @@ module.exports = React.createClass({ } } else this.startTimer() }, + componentWillUnmount: function () { + if (this.timer) clearTimeout(this.timer) + }, startTimer: function () { - setTimeout(_ => { + this.timer = setTimeout(_ => { console.log('Connection to go-ipfs has timed out (probably due to CORS)') if (this.isMounted()) this.setState({ long: true }) }, 5000)