From f48b79c2cffe2e15bd8a973046a48a9b2dd9f111 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 17 Oct 2015 22:34:30 -0700 Subject: [PATCH] Disable gallery preloading unless moving forward by one. Otherwise it can cause more performance problems than it fixes. --- src/Images/Gallery.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 792174ea2..a9799d923 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -187,7 +187,8 @@ Gallery = Header.scrollTo post.nodes.root # Preload next image - Gallery.cache = Gallery.load Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError + if isNaN(oldID) or newID is (oldID + 1) % Gallery.images.length + Gallery.cache = Gallery.load Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError error: -> if @error?.code is MediaError.MEDIA_ERR_DECODE