From 6e511ee6737d01e0d9ee1133f9c31d7270f29eac Mon Sep 17 00:00:00 2001 From: Naoki Kosaka Date: Wed, 12 Jul 2017 02:56:45 +0900 Subject: [PATCH] Fix media modal prev button behavior. (#4158) --- app/javascript/mastodon/features/ui/components/media_modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/ui/components/media_modal.js b/app/javascript/mastodon/features/ui/components/media_modal.js index 23f588669f..d869fffa67 100644 --- a/app/javascript/mastodon/features/ui/components/media_modal.js +++ b/app/javascript/mastodon/features/ui/components/media_modal.js @@ -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) => {