From b21ab498f84b75288f20a7eb2c6e0ee223481674 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 23f588669..d869fffa6 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) => {