From b85f525758a24838d93e349755dad5d671b9c4c8 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 5 Dec 2011 18:37:11 +0100 Subject: [PATCH] Verify that data.version is actually sent, should resolve issue #29 --- 4chan_x.user.js | 2 +- changelog | 2 ++ script.coffee | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 198735e08..559bc8bc2 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3064,7 +3064,7 @@ origin = e.origin, data = e.data; if (origin === 'http://sys.4chan.org') { return qr.message(data); - } else if (data.version !== VERSION && confirm('An updated version of 4chan X is available, would you like to install it now?')) { + } else if (data.version && data.version !== VERSION && confirm('An updated version of 4chan X is available, would you like to install it now?')) { return window.location = "https://raw.github.com/mayhemydg/4chan-x/" + data.version + "/4chan_x.user.js"; } }, diff --git a/changelog b/changelog index e8c3ed852..41da7637e 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- mayhem + fix obscure and continuous prompts to auto update 2.22.1 - mayhem diff --git a/script.coffee b/script.coffee index ee553972f..ab0e97dd4 100644 --- a/script.coffee +++ b/script.coffee @@ -2437,7 +2437,7 @@ Main = {origin, data} = e if origin is 'http://sys.4chan.org' qr.message data - else if data.version isnt VERSION and confirm 'An updated version of 4chan X is available, would you like to install it now?' + else if data.version and data.version isnt VERSION and confirm 'An updated version of 4chan X is available, would you like to install it now?' window.location = "https://raw.github.com/mayhemydg/4chan-x/#{data.version}/4chan_x.user.js" node: (e) ->