]> cat aescling's git repositories - mastodon.git/commitdiff
Fix media modal prev button behavior. (#4158)
authorNaoki Kosaka <n.k@mail.yukimochi.net>
Tue, 11 Jul 2017 17:56:45 +0000 (02:56 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 11 Jul 2017 17:56:45 +0000 (19:56 +0200)
app/javascript/mastodon/features/ui/components/media_modal.js

index 23f588669f19a00c654aac7796f32b8897495fa6..d869fffa677eb2a539bec4766b9bddc5ce139b46 100644 (file)
@@ -35,7 +35,7 @@ export default class MediaModal extends ImmutablePureComponent {
   }
 
   handlePrevClick = () => {
-    this.setState({ index: (this.getIndex() - 1) % this.props.media.size });
+    this.setState({ index: (this.props.media.size + this.getIndex() - 1) % this.props.media.size });
   }
 
   handleKeyUp = (e) => {