Verify that data.version is actually sent, should resolve issue #29

This commit is contained in:
Nicolas Stepien 2011-12-05 18:37:11 +01:00
parent dc0386a05c
commit b85f525758
3 changed files with 4 additions and 2 deletions

View File

@ -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";
}
},

View File

@ -1,4 +1,6 @@
master
- mayhem
fix obscure and continuous prompts to auto update
2.22.1
- mayhem

View File

@ -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) ->