1
0
mirror of https://github.com/fazo96/ipfs-boards synced 2025-01-10 12:24:20 +01:00

fix missing cleanup

This commit is contained in:
Enrico Fasoli 2015-12-15 17:20:57 +01:00
parent 6685340b42
commit 359152ad02

View File

@ -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)