From 751fef81dd6402dac88f3a32aa6733336cee53ea Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 26 Feb 2013 19:11:52 +0100 Subject: [PATCH] That's simpler. --- 4chan_x.user.js | 10 +++------- src/qr.coffee | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index c6a489370..933f06b99 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -5720,9 +5720,7 @@ close: function() { var i, _i, _len, _ref; if (QR.req) { - if (!QR.req.isUploadFinished) { - QR.abort(); - } + QR.abort(); return; } QR.nodes.el.hidden = true; @@ -6523,9 +6521,7 @@ e.preventDefault(); } if (QR.req) { - if (!QR.req.isUploadFinished) { - QR.abort(); - } + QR.abort(); return; } if (QR.cooldown.seconds) { @@ -6704,7 +6700,7 @@ return QR.status(); }, abort: function() { - if (QR.req) { + if (QR.req && !QR.req.isUploadFinished) { QR.req.abort(); delete QR.req; QR.notifications.push(new Notification('info', 'QR upload aborted.', 5)); diff --git a/src/qr.coffee b/src/qr.coffee index 61c5b6d02..663c5564f 100644 --- a/src/qr.coffee +++ b/src/qr.coffee @@ -63,7 +63,7 @@ QR = error: err close: -> if QR.req - QR.abort() unless QR.req.isUploadFinished + QR.abort() return QR.nodes.el.hidden = true QR.cleanNotifications() @@ -740,7 +740,7 @@ QR = e?.preventDefault() if QR.req - QR.abort() unless QR.req.isUploadFinished + QR.abort() return if QR.cooldown.seconds @@ -933,7 +933,7 @@ QR = QR.status() abort: -> - if QR.req + if QR.req and !QR.req.isUploadFinished QR.req.abort() delete QR.req QR.notifications.push new Notification 'info', 'QR upload aborted.', 5