Don't submit a new thread without a selected file. Fix #485.

This commit is contained in:
Nicolas Stepien 2012-05-19 14:01:53 +02:00
parent 605c09e4ec
commit d12c78ea39
2 changed files with 5 additions and 5 deletions

View File

@ -1951,7 +1951,8 @@
}
QR.abort();
reply = QR.replies[0];
if (!(reply.com || reply.file)) {
threadID = g.THREAD_ID || $('select', QR.el).value;
if (!(threadID === 'new' && reply.file || threadID !== 'new' && (reply.com || reply.file))) {
err = 'No file selected.';
} else {
captchas = $.get('captchas', []);
@ -1980,7 +1981,6 @@
return;
}
QR.cleanError();
threadID = g.THREAD_ID || $('select', QR.el).value;
QR.cooldown.auto = QR.replies.length > 1;
if (Conf['Auto Hide QR'] && !QR.cooldown.auto) {
QR.hide();

View File

@ -1471,8 +1471,10 @@ QR =
QR.abort()
reply = QR.replies[0]
threadID = g.THREAD_ID or $('select', QR.el).value
# prevent errors
unless reply.com or reply.file
unless threadID is 'new' and reply.file or threadID isnt 'new' and (reply.com or reply.file)
err = 'No file selected.'
else
# get oldest valid captcha
@ -1499,8 +1501,6 @@ QR =
return
QR.cleanError()
threadID = g.THREAD_ID or $('select', QR.el).value
# Enable auto-posting if we have stuff to post, disable it otherwise.
QR.cooldown.auto = QR.replies.length > 1
if Conf['Auto Hide QR'] and not QR.cooldown.auto