mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-01-25 14:54:19 +01:00
fix missing cleanup
This commit is contained in:
parent
6685340b42
commit
359152ad02
@ -24,8 +24,11 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
} else this.startTimer()
|
} else this.startTimer()
|
||||||
},
|
},
|
||||||
|
componentWillUnmount: function () {
|
||||||
|
if (this.timer) clearTimeout(this.timer)
|
||||||
|
},
|
||||||
startTimer: function () {
|
startTimer: function () {
|
||||||
setTimeout(_ => {
|
this.timer = setTimeout(_ => {
|
||||||
console.log('Connection to go-ipfs has timed out (probably due to CORS)')
|
console.log('Connection to go-ipfs has timed out (probably due to CORS)')
|
||||||
if (this.isMounted()) this.setState({ long: true })
|
if (this.isMounted()) this.setState({ long: true })
|
||||||
}, 5000)
|
}, 5000)
|
||||||
|
Loading…
Reference in New Issue
Block a user