From cd7926d45b7e5b356f985f4bda52d49986eaf45f Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 14 Feb 2013 09:54:33 +0100 Subject: [PATCH] Don't try to re-expand an image on download error if we already contracted it. --- 4chan_x.user.js | 5 ++++- src/features.coffee | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 059db7818..c50062b08 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3555,8 +3555,11 @@ error: function() { var URL, post, src, timeoutID; post = Get.postFromNode(this); - ImageExpand.contract(post); $.rm(this); + ImageExpand.contract(post); + if (this.hidden) { + return; + } src = this.src.split('/'); if (!(src[2] === 'images.4chan.org' && (URL = Redirect.image(src[3], src[5])))) { if (g.DEAD) { diff --git a/src/features.coffee b/src/features.coffee index f69e2d939..5dd36a7cc 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -2183,8 +2183,11 @@ ImageExpand = error: -> post = Get.postFromNode @ - ImageExpand.contract post $.rm @ + ImageExpand.contract post + if @hidden + # Don't try to re-expend if it was already contracted. + return src = @src.split '/' unless src[2] is 'images.4chan.org' and URL = Redirect.image src[3], src[5] return if g.DEAD