From: Eugen Rochko Date: Mon, 16 Oct 2017 01:03:36 +0000 (+0200) Subject: Clear timer when unmounting RelativeTimestamp components (#5408) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=894da3dcca781e27ce9c5130f1021526ac8a6887;p=mastodon.git Clear timer when unmounting RelativeTimestamp components (#5408) Possibly the cause of #5379, #5377 --- diff --git a/app/javascript/mastodon/components/relative_timestamp.js b/app/javascript/mastodon/components/relative_timestamp.js index 534d83fac..51588e78c 100644 --- a/app/javascript/mastodon/components/relative_timestamp.js +++ b/app/javascript/mastodon/components/relative_timestamp.js @@ -94,6 +94,10 @@ export default class RelativeTimestamp extends React.Component { this._scheduleNextUpdate(nextProps, nextState); } + componentWillUnmount () { + clearTimeout(this._timer); + } + _scheduleNextUpdate (props, state) { clearTimeout(this._timer);