]> cat aescling's git repositories - mastodon.git/commitdiff
Clear timer when unmounting RelativeTimestamp components (#5408)
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 16 Oct 2017 01:03:36 +0000 (03:03 +0200)
committerGitHub <noreply@github.com>
Mon, 16 Oct 2017 01:03:36 +0000 (03:03 +0200)
Possibly the cause of #5379, #5377

app/javascript/mastodon/components/relative_timestamp.js

index 534d83face442c05a4f2bf78361d7b8e941b861d..51588e78ca1684aced5b58398a9b53b2f0cfe517 100644 (file)
@@ -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);