]> cat aescling's git repositories - mastodon.git/commitdiff
Fix error on reloading status detail column (#5248)
authorK.SHIRAKASHI <k.shira86@gmail.com>
Fri, 6 Oct 2017 18:37:56 +0000 (03:37 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 6 Oct 2017 18:37:56 +0000 (20:37 +0200)
app/javascript/mastodon/features/status/index.js

index 83e83540a19f16885a2c632ef9321f245fe6a68c..abcfee99e788ea20ead00e510d18ee063503b8e4 100644 (file)
@@ -242,8 +242,8 @@ export default class Status extends ImmutablePureComponent {
   componentDidUpdate () {
     const { ancestorsIds } = this.props;
 
-    if (ancestorsIds) {
-      const element = this.node.querySelectorAll('.focusable')[this.props.ancestorsIds.size];
+    if (ancestorsIds && ancestorsIds.size > 0) {
+      const element = this.node.querySelectorAll('.focusable')[ancestorsIds.size];
       element.scrollIntoView();
     }
   }